PageSourceSearch

https://www.namespace.world/assets/BlogDetail-B-U-vcyt.js

js namespace.world collected 2026-10-09 23:11:56 UTC 6,530 bytes, 15 lines download raw bytes

1import{j as t}from"./ui-C8sRQjV2.js";import{r as a,h as w,e as E}from"./vendor-D2r5Dgbz.js";import{h as S,K as k,B as A,a0 as B,g as C}from"./index-Bn-QXQxN.js";import{B as q}from"./badge-Bj90dfG-.js";import{L}from"./list-Du6wMcrY.js";import{L as P}from"./loader-circle-B9Nxe3Zm.js";import{A as $}from"./arrow-left-DHdNjJL5.js";import"./supabase-DplbTa1P.js";const I=({contentRef:m})=>{const[l,s]=a.useState([]),[g,p]=a.useState("");a.useEffect(()=>{const r=m.current;if(!r)return;const n=r.querySelectorAll("h1, h2, h3"),e=[];n.forEach((i,o)=>{const c=i.id||`heading-${o}`;i.id||(i.id=c),e.push({id:c,text:i.textContent||"",level:parseInt(i.tagName[1])})}),s(e),e.length>0&&p(e[0].id)},[m]);const u=a.useCallback(()=>{if(l.length===0)return;let r=l[0].id;for(const n of l){const e=document.getElementById(n.id);e&&e.getBoundingClientRect().top<=120&&(r=n.id)}p(r)},[l]);return a.useEffect(()=>(window.addEventListener("scroll",u,{passive:!0}),()=>window.removeEventListener("scroll",u)),[u]),l.length===0?null:t.jsxs("nav",{className:"sticky top-24 max-h-[calc(100vh-8rem)] overflow-y-auto",children:[t.jsxs("div",{className:"flex items-center gap-2 mb-3 text-sm font-semibold text-foreground",children:[t.jsx(L,{className:"h-4 w-4"}),"On this page"]}),t.jsx("ul",{className:"space-y-1 border-l border-border",children:l.map(r=>t.jsx("li",{children:t.jsx("a",{href:`#${r.id}`,onClick:n=>{var e;n.preventDefault(),(e=document.getElementById(r.id))==null||e.scrollIntoView({behavior:"smooth",block:"start"})},className:S("block py-1 text-sm transition-colors border-l-2 -ml-px",r.level===1&&"pl-3",r.level===2&&"pl-5",r.level===3&&"pl-7",g===r.id?"border-primary text-primary font-medium":"border-transparent text-muted-foreground hover:text-foreground hover:border-muted-foreground/50"),children:r.text})},r.id))})]})},J=()=>{const{slug:m}=w(),l=E(),[s,g]=a.useState(null),[p,u]=a.useState(!0),r=a.useRef(null);a.useEffect(()=>(n(),()=>{document.title="NAMESPACE Ecosystem – Space for Humans and Organizations in Tech";const e=document.querySelector("script[data-blog-ld]");e&&e.remove()}),[m]);const n=async()=>{const{data:e,error:i}=await k.from("blogs").select("*").eq("slug",m).eq("is_published",!0).single();if(i||!e){l("/blogs");return}g(e),u(!1),document.title=`${e.title} | NAMESPACE Blog`;const o=(v,y,j=!1)=>{const N=j?"name":"property";let d=document.querySelector(`meta[${N}='${v}']`);d?d.content=y:(d=document.createElement("meta"),d.setAttribute(N,v),d.content=y,document.head.appendChild(d))},c=e.excerpt||(e.content?e.content.replace(/<[^>]*>/g,"").substring(0,155)+"...":`Read ${e.title} on the NAMESPACE blog.`),f=`https://namespace.world/blogs/${e.slug}`,b=e.banner_url||"https://namespace.world/lovable-uploads/27940758-e8d3-4460-b88e-21b8102f741f.png";o("description",c,!0),o("og:title",`${e.title} | NAMESPACE Blog`),o("og:description",c),o("og:url",f),o("og:type","article"),o("og:image",b),o("twitter:card","summary_large_image"),o("twitter:title",`${e.title} | NAMESPACE Blog`),o("twitter:description",c),o("twitter:image",b),e.author_name&&o("article:author",e.author_name),e.published_at&&o("article:published_time",e.published_at);const _=document.querySelector("script[data-blog-ld]");_&&_.remove();const x={"@context":"https://schema.org","@type":"BlogPosting",headline:e.title,description:c,url:f,image:b,publisher:{"@type":"Organization",name:"NAMESPACE",url:"https://namespace.world"}};e.author_name&&(x.author={"@type":"Person",name:e.author_name}),e.published_at&&(x.datePublished=e.published_at);const h=document.createElement("script");h.type="application/ld+json",h.setAttribute("data-blog-ld","true"),h.textContent=JSON.stringify(x),document.head.appendChild(h)};return p?t.jsx("div",{className:"flex items-center justify-center min-h-[60vh]",children:t.jsx(P,{className:"h-8 w-8 animate-spin text-primary"})}):s?t.jsxs("div",{className:"relative",children:[t.jsx("aside",{className:"hidden xl:block fixed left-0 top-16 w-60 h-[calc(100vh-4rem)] border-r border-border bg-background/95 backdrop-blur-sm z-10 p-6 overflow-y-auto",children:t.jsx(I,{contentRef:r})}),t.jsx("div",{className:"xl:ml-60",children:t.jsxs("div",{className:"container mx-auto px-4 py-8 max-w-3xl",children:[t.jsxs(A,{variant:"ghost",className:"mb-6",onClick:()=>l("/blogs"),children:[t.jsx($,{className:"h-4 w-4 mr-2"}),"Back to Blogs"]}),s.banner_url&&t.jsx("div",{className:"aspect-[2.5/1] overflow-hidden rounded-xl mb-8",children:t.jsx("img",{src:s.banner_url,alt:s.title,className:"w-full h-full object-cover"})}),t.jsx("div",{className:"flex flex-wrap gap-2 mb-4",children:(s.tags||[]).map(e=>t.jsx(q,{variant:"secondary",children:e},e))}),t.jsx("h1",{className:"text-4xl font-bold mb-4",children:s.title}),t.jsxs("div",{className:"flex items-center gap-4 text-sm text-muted-foreground mb-8 pb-8 border-b",children:[s.author_name&&t.jsxs("span",{className:"flex items-center gap-1",children:[t.jsx(B,{className:"h-4 w-4"}),s.author_name]}),t.jsxs("span",{className:"flex items-center gap-1",children:[t.jsx(C,{className:"h-4 w-4"}),new Date(s.published_at||s.created_at).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})]})]}),t.jsx("div",{ref:r,className:`prose prose-lg dark:prose-invert max-w-none !text-foreground
2              [&_*]:!bg-transparent [&_*]:!text-inherit
3              [&_h1]:!text-foreground [&_h1]:text-3xl [&_h1]:font-bold [&_h1]:mb-4 [&_h1]:mt-8 [&_h1]:scroll-mt-20
4              [&_h2]:!text-foreground [&_h2]:text-2xl [&_h2]:font-semibold [&_h2]:mb-3 [&_h2]:mt-6 [&_h2]:scroll-mt-20
5              [&_h3]:!text-foreground [&_h3]:text-xl [&_h3]:font-semibold [&_h3]:mb-2 [&_h3]:mt-5 [&_h3]:scroll-mt-20
6              [&_p]:mb-4 [&_p]:leading-relaxed [&_p]:!text-foreground
7              [&_span]:!text-foreground
8              [&_li]:mb-1 [&_li]:!text-foreground
9              [&_blockquote]:border-l-4 [&_blockquote]:border-primary [&_blockquote]:pl-4 [&_blockquote]:italic [&_blockquote]:my-6 [&_blockquote]:!text-muted-foreground
10              [&_pre]:!bg-muted [&_pre]:p-4 [&_pre]:rounded-md [&_pre]:overflow-x-auto [&_pre]:my-6 [&_pre]:!text-foreground
11              [&_ul]:list-disc [&_ul]:pl-6 [&_ul]:mb-4
12              [&_ol]:list-decimal [&_ol]:pl-6 [&_ol]:mb-4
13              [&_a]:!text-primary [&_a]:underline
14              [&_img]:max-w-full [&_img]:h-auto [&_img]:rounded-lg [&_img]:my-6 [&_img]:mx-auto [&_img]:block
15              [&_hr]:my-8 [&_hr]:border-border`,dangerouslySetInnerHTML:{__html:s.content||""}})]})})]}):null};export{J 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.