PageSourceSearch

https://dylanbochman.netlify.app/assets/BlogPost-C1dunZdo.js

js dylanbochman.netlify.app collected 2026-10-03 10:40:25 UTC 13,922 bytes, 1 lines download raw bytes

1import{r as c,j as e,Y as k,Z as C,_ as P,$ as S,a0 as L,a1 as A,L as g,a2 as N,a3 as D,a4 as f,B,a5 as $,a6 as E,a7 as M}from"./vendor-B8mTEsSR.js";import{e as R,r as T,a as _,f as I,b as O}from"./mdx-runtime-CxWVQ6jF.js";import{B as b,P as h}from"./index-B1jOIFiH.js";import{b as U,l as V}from"./blog-loader-Bmfj_pCa.js";import{z as W}from"./theme-FyGxoSVC.js";import"./ui-Dc_FVRD7.js";import"./blog-loader-BhJ8bIFE.js";import"./monitoring-DrLQlyIz.js";function X({children:t,className:s}){const[l,i]=c.useState(!1),r=c.useRef(null),o=async()=>{const n=r.current?.querySelector("code");if(n){const u=n.textContent||"";try{await navigator.clipboard.writeText(u),i(!0),setTimeout(()=>i(!1),2e3)}catch(m){console.error("Failed to copy code:",m)}}};return e.jsxs("div",{className:"relative group",children:[e.jsx("button",{onClick:o,className:"absolute right-2 top-2 p-2 rounded-md bg-muted/80 hover:bg-muted transition-colors opacity-0 group-hover:opacity-100 focus:opacity-100","aria-label":"Copy code to clipboard",type:"button",children:l?e.jsx(k,{className:"w-4 h-4 text-green-500"}):e.jsx(C,{className:"w-4 h-4 text-muted-foreground"})}),e.jsx("pre",{ref:r,className:`my-4 overflow-x-auto rounded-lg bg-muted p-4 text-sm ${s||""}`,children:t})]})}const q={info:{bg:"bg-blue-50 dark:bg-blue-950/30",border:"border-blue-200 dark:border-blue-800",icon:e.jsx(A,{className:"w-5 h-5 text-blue-600 dark:text-blue-400"})},warning:{bg:"bg-yellow-50 dark:bg-yellow-950/30",border:"border-yellow-200 dark:border-yellow-800",icon:e.jsx(L,{className:"w-5 h-5 text-yellow-600 dark:text-yellow-400"})},success:{bg:"bg-green-50 dark:bg-green-950/30",border:"border-green-200 dark:border-green-800",icon:e.jsx(S,{className:"w-5 h-5 text-green-600 dark:text-green-400"})},error:{bg:"bg-red-50 dark:bg-red-950/30",border:"border-red-200 dark:border-red-800",icon:e.jsx(P,{className:"w-5 h-5 text-red-600 dark:text-red-400"})}};function G({type:t="info",title:s,children:l}){const i=q[t];return e.jsx("div",{className:`my-6 rounded-lg border-l-4 ${i.border} ${i.bg} p-4`,children:e.jsxs("div",{className:"flex gap-3",children:[e.jsx("div",{className:"flex-shrink-0 mt-0.5",children:i.icon}),e.jsxs("div",{className:"flex-1",children:[s&&e.jsx("div",{className:"font-semibold mb-2 text-foreground",children:s}),e.jsx("div",{className:"text-foreground/90 [&>p]:my-2 [&>p:first-child]:mt-0 [&>p:last-child]:mb-0",children:l})]})]})})}function j({src:t,alt:s,caption:l,width:i,height:r}){const[o,n]=c.useState(!1);return e.jsxs("figure",{className:"my-6",children:[e.jsxs("div",{className:"relative overflow-hidden rounded-lg bg-muted",children:[!o&&e.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:e.jsx("div",{className:"text-sm text-muted-foreground",children:"Loading..."})}),e.jsx("img",{src:t,alt:s,width:i,height:r,loading:"lazy",onLoad:()=>n(!0),className:`w-full h-auto transition-opacity duration-300 ${o?"opacity-100":"opacity-0"}`})]}),l&&e.jsx("figcaption",{className:"mt-2 text-center text-sm text-muted-foreground italic",children:l})]})}const y={h1:({children:t})=>e.jsx("h1",{className:"text-4xl font-bold mt-8 mb-4 text-foreground scroll-mt-20",id:String(t).toLowerCase().replace(/\s+/g,"-"),children:t}),h2:({children:t})=>e.jsx("h2",{className:"text-3xl font-bold mt-8 mb-4 text-foreground scroll-mt-20",id:String(t).toLowerCase().replace(/\s+/g,"-"),children:t}),h3:({children:t})=>e.jsx("h3",{className:"text-2xl font-semibold mt-6 mb-3 text-foreground scroll-mt-20",id:String(t).toLowerCase().replace(/\s+/g,"-"),children:t}),h4:({children:t})=>e.jsx("h4",{className:"text-xl font-semibold mt-4 mb-2 text-foreground scroll-mt-20",id:String(t).toLowerCase().replace(/\s+/g,"-"),children:t}),h5:({children:t})=>e.jsx("h5",{className:"text-lg font-semibold mt-4 mb-2 text-foreground scroll-mt-20",id:String(t).toLowerCase().replace(/\s+/g,"-"),children:t}),h6:({children:t})=>e.jsx("h6",{className:"text-base font-semibold mt-4 mb-2 text-foreground scroll-mt-20",id:String(t).toLowerCase().replace(/\s+/g,"-"),children:t}),p:({children:t})=>
1e.jsx("p",{className:"my-4 text-foreground/80 leading-7",children:t}),a:({href:t,children:s})=>e.jsx("a",{href:t,className:"text-primary underline hover:text-primary/80 font-medium",target:t?.startsWith("http")?"_blank":void 0,rel:t?.startsWith("http")?"noopener noreferrer":void 0,children:s}),ul:({children:t})=>e.jsx("ul",{className:"my-4 ml-6 list-disc space-y-2 text-foreground/80",children:t}),ol:({children:t})=>e.jsx("ol",{className:"my-4 ml-6 list-decimal space-y-2 text-foreground/80",children:t}),li:({children:t})=>e.jsx("li",{className:"leading-7",children:t}),pre:({children:t,className:s})=>e.jsx(X,{className:s,children:t}),code:({children:t,className:s})=>s?e.jsx("code",{className:`${s||""} font-mono`,children:t}):e.jsx("code",{className:"rounded bg-muted px-1.5 py-0.5 text-sm font-mono text-foreground",children:t}),blockquote:({children:t})=>e.jsx("blockquote",{className:"my-4 border-l-4 border-primary pl-4 italic text-foreground/70",children:t}),hr:()=>e.jsx("hr",{className:"my-8 border-border"}),table:({children:t})=>e.jsx("div",{className:"my-4 overflow-x-auto",children:e.jsx("table",{className:"w-full border-collapse",children:t})}),thead:({children:t})=>e.jsx("thead",{className:"bg-muted",children:t}),tbody:({children:t})=>e.jsx("tbody",{children:t}),tr:({children:t})=>e.jsx("tr",{className:"border-b border-border",children:t}),th:({children:t})=>e.jsx("th",{className:"px-4 py-2 text-left font-semibold text-foreground",children:t}),td:({children:t})=>e.jsx("td",{className:"px-4 py-2 text-foreground/80",children:t}),img:({src:t,alt:s})=>e.jsx(j,{src:t||"",alt:s||""}),strong:({children:t})=>e.jsx("strong",{className:"font-bold text-foreground",children:t}),em:({children:t})=>e.jsx("em",{className:"italic",children:t}),Callout:G,BlogImage:j};function F({slug:t}){const s=c.useRef(null),[l,i]=c.useState(!1),{theme:r}=W(),o=c.useRef(null);c.useEffect(()=>{if(!s.current)return;const d=new IntersectionObserver(a=>{a[0].isIntersecting&&(i(!0),d.disconnect())},{rootMargin:"200px"});return d.observe(s.current),()=>d.disconnect()},[]);const n=()=>r==="dark"||r==="system"&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",u=d=>{s.current?.querySelector("iframe.giscus-frame")?.contentWindow?.postMessage({giscus:{setConfig:{theme:d}}},"https://giscus.app")},m=d=>{if(!s.current)return;s.current.innerHTML="";const a=document.createElement("script");a.src="https://giscus.app/client.js",a.setAttribute("data-repo","Dbochman/personal-website"),a.setAttribute("data-repo-id","R_kgDOO7-rBw"),a.setAttribute("data-category","General"),a.setAttribute("data-category-id","DIC_kwDOO7-rB84C0ubL"),a.setAttribute("data-mapping","specific"),a.setAttribute("data-term",t),a.setAttribute("data-strict","0"),a.setAttribute("data-reactions-enabled","1"),a.setAttribute("data-emit-metadata","0"),a.setAttribute("data-input-position","bottom"),a.setAttribute("data-theme",d),a.setAttribute("data-lang","en"),a.setAttribute("crossorigin","anonymous"),a.async=!0,s.current.appendChild(a)};return c.useEffect(()=>{if(!l||!s.current)return;const d=n();if(o.current!==t){o.current=t,m(d);return}u(d)},[l,t,r]),e.jsxs("div",{className:"mt-12 pt-8 border-t border-border",children:[e.jsx("h2",{className:"text-2xl font-bold mb-6",children:"Comments"}),e.jsx("div",{ref:s,className:"giscus-container",children:!l&&e.jsx("div",{className:"text-center text-muted-foreground py-8",children:"Comments will load when you scroll down..."})})]})}function H({currentPost:t,allPosts:s,maxPosts:l=3}){const i=s.filter(r=>r.slug!==t.slug&&!r.draft).map(r=>{const o=r.tags.filter(n=>t.tags.includes(n));return{post:r,sharedTags:o,score:o.length}}).filter(r=>r.score>0).sort((r,o)=>o.score-r.score).slice(0,l);return i.length===0?null:e.jsxs("div",{className:"mt-12 pt-8 border-t border-border",children:[e.jsx("h2",{className:"text-2xl font-bold mb-6",children:"Related Posts"}),e.jsx("div",{className:"grid gap-6 md:grid-cols-2 lg:grid-cols-3",children:i.map(({post:r,sharedTags:o})=>e.jsxs(g,{to:`/blog/${r.slug}`,className:"group block p-4 rounded-lg border border-border hover:border-primary transition-colors",children:[e.jsx("h3",{className:"font-semibold text-lg mb-2 group-hover:text-primary transition-colors line-clamp-2",children:r.title}),e.jsx("p",{className:"text-sm text-muted-foreground mb-3 line-clamp-2",children:r.description}),e.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground mb-3",children:[e.jsx(N,{className:"w-3 h-3"}),e.jsx("time",{dateTime:r.date,children:new Date(r.date).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})})]}),e.jsxs("div",{className:"flex flex-wrap gap-1",children:[o.map(n=>e.jsx(b,{variant:"default",className:"text-xs",children:n},n)),r.tags.filter(n=>!o.includes(n)).slice(0,Math.max(0,2-o.length)).map(n=>e.jsx(b,{variant:"secondary",className:"text-xs",children:n},n))]})]},r.slug))})]})}function se(){const{slug:t}=D(),[s,l]=c.useState(null),[i,r]=c.useState([]),[o,n]=c.useState(null),[u,m]=c.useState(!0),[d,a]=c.useState(null);return c.useEffect(()=>{if(!t){a("No post slug provided"),m(!1);return}(async()=>{try{const[p,w]=await Promise.all([U(t),V()]);if(!p){a("Post not found"),m(!1);return}l(p),r(w);const{default:v}=await R(p.content,{...M,remarkPlugins:[O],rehypePlugins:[T,[_,{behavior:"wrap"}],I],useMDXComponents:()=>y});n(()=>v),m(!1)}catch(p){console.error("Error loading blog post:",p),a("Failed to load blog post"),m(!1)}})()},[t]),u?e.jsx(h,{children:e.jsx("div",{className:"flex items-center justify-center py-12",children:e.jsx("div",{className:"text-muted-foreground",children:"Loading post..."})})}):d||!s?e.jsx(h,{children:e.jsx("div",{className:"container mx-auto px-4 py-12",children:e.jsxs("div",{className:"max-w-3xl mx-auto",children:[e.jsx("div",{className:"bg-destructive/10 text-destructive px-4 py-3 rounded-md mb-4",children:d||"Post not found"}),e.jsxs(g,{to:"/blog",className:"inline-flex items-center gap-2 text-primary hover:underline",children:[e.jsx(f,{className:"w-4 h-4"}),"View all posts"]})]})})}):e.jsxs(e.Fragment,{children:[e.jsxs(B,{children:[e.jsxs("title",{children:[s.title," - Dylan Bochman"]}),e.jsx("meta",{name:"description",content:s.description}),e.jsx("meta",{name:"keywords",content:s.tags.join(", ")}),e.jsx("meta",{name:"author",content:s.author}),e.jsx("meta",{property:"og:type",content:"article"}),e.jsx("meta",{property:"og:url",content:`https://dylanbochman.com/blog/${s.slug}`}),e.jsx("meta",{property:"og:title",content:s.title}),e.jsx("meta",{property:"og:description",content:s.description}),e.jsx("meta",{property:"og:image",content:s.image||"https://dylanbochman.com/social-preview.webp"}),e.jsx("meta",{property:"og:site_name",content:"Dylan Bochman"}),e.jsx("meta",{property:"article:published_time",content:s.date}),s.updated&&e.jsx("meta",{property:"article:modified_time",content:s.updated}),e.jsx("meta",{property:"article:author",content:s.author}),s.tags.map(x=>e.jsx("meta",{property:"article:tag",content:x},x)),e.jsx("meta",{name:"twitter:card",content:"summary_large_image"}),e.jsx("meta",{name:"twitter:url",content:`https://dylanbochman.com/blog/${s.slug}`}),e.jsx("meta",{name:"twitter:title",content:s.title}),e.jsx("meta",{name:"twitter:description",content:s.description}),e.jsx("meta",{name:"twitter:image",content:s.image||"https://dylanbochman.com/social-preview.webp"}),e.jsx("link",{rel:"canonical",href:`https://dylanbochman.com/blog/${s.slug}`}),e.jsx("script",{type:"application/ld+json",children:JSON.stringify({"@context":"https://schema.org","@type":"BlogPosting",headline:s.title,de
1scription:s.description,image:s.image||"https://dylanbochman.com/social-preview.webp",datePublished:s.date,dateModified:s.updated||s.date,author:{"@type":"Person",name:s.author,url:"https://dylanbochman.com"},publisher:{"@type":"Person",name:"Dylan Bochman",url:"https://dylanbochman.com"},mainEntityOfPage:{"@type":"WebPage","@id":`https://dylanbochman.com/blog/${s.slug}`},keywords:s.tags.join(", ")})})]}),e.jsx(h,{children:e.jsx("div",{className:"container mx-auto px-4 py-12",children:e.jsxs("div",{className:"max-w-3xl mx-auto",children:[e.jsxs(g,{to:"/blog",className:"inline-flex items-center gap-2 text-muted-foreground hover:text-foreground transition-colors mb-8",children:[e.jsx(f,{className:"w-4 h-4"}),"View all posts"]}),e.jsxs("header",{className:"mb-8",children:[e.jsx("h1",{className:"text-4xl md:text-5xl font-bold mb-4",children:s.title}),e.jsxs("div",{className:"flex flex-wrap items-center gap-4 text-sm text-muted-foreground mb-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(N,{className:"w-4 h-4"}),e.jsx("time",{dateTime:s.date,children:new Date(s.date).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx($,{className:"w-4 h-4"}),e.jsx("span",{children:s.readingTime})]}),s.updated&&e.jsxs("div",{className:"text-xs",children:["Updated: ",new Date(s.updated).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})]})]}),e.jsx("p",{className:"text-xl text-muted-foreground mb-6",children:s.description}),e.jsx("div",{className:"flex flex-wrap gap-2",children:s.tags.map(x=>e.jsx(b,{variant:"secondary",children:x},x))})]}),e.jsx("article",{className:"prose prose-lg max-w-none",children:o&&e.jsx(E,{components:y,children:e.jsx(o,{})})}),e.jsx(H,{currentPost:s,allPosts:i}),e.jsx(F,{slug:s.slug}),e.jsx("footer",{className:"mt-12 pt-8 border-t border-border",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"text-sm text-muted-foreground",children:["Written by ",s.author]}),e.jsx(g,{to:"/blog",className:"text-sm text-primary hover:underline",children:"View all posts →"})]})})]})})})]})}export{se as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.