diff options
| author | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-05-27 20:50:16 +0300 |
|---|---|---|
| committer | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-05-27 20:51:48 +0300 |
| commit | 7ebc72f3f5de24a293db144cd1745cea52c3e717 (patch) | |
| tree | 355a1c7c04a69af7023cc8afa7ee675596687253 /website/src/pages/blog | |
| parent | 4ec4d56fcf985e4464bce6b76e3578e9c941ad50 (diff) | |
feat: add website release notes
Diffstat (limited to 'website/src/pages/blog')
| -rw-r--r-- | website/src/pages/blog/[slug].astro | 88 | ||||
| -rw-r--r-- | website/src/pages/blog/index.astro | 38 |
2 files changed, 126 insertions, 0 deletions
diff --git a/website/src/pages/blog/[slug].astro b/website/src/pages/blog/[slug].astro new file mode 100644 index 00000000..10939fd0 --- /dev/null +++ b/website/src/pages/blog/[slug].astro @@ -0,0 +1,88 @@ +--- +import { getCollection, render } from 'astro:content'; +import MarketingLayout from '../../components/MarketingLayout.astro'; + +export async function getStaticPaths() { + const posts = await getCollection('blog'); + return posts + .filter((post) => !post.data.draft) + .map((post) => { + const slug = post.id.replace(/\.(md|mdx)$/i, ''); + return { + params: { slug }, + props: { post, slug }, + }; + }); +} + +const { post, slug } = Astro.props; +const { Content, headings } = await render(post); +const sectionHeadings = headings.filter((heading) => heading.depth === 2); +--- + +<MarketingLayout + title={`${post.data.title} — Herdr blog`} + description={post.data.description} + canonicalPath={`/blog/${slug}/`} + ogType="article" +> + <main class="content-shell"> + <div class="article-layout section"> + <aside class="article-toc" aria-label="Article sections"> + <p>Sections</p> + <nav> + {sectionHeadings.map((heading) => ( + <a href={`#${heading.slug}`} data-heading-link={heading.slug}>{heading.text}</a> + ))} + </nav> + </aside> + + <article class="article-shell"> + <header class="article-header"> + <p class="post-meta"> + <a href="/blog/">Blog</a> + <time datetime={post.data.date.toISOString()}>{post.data.date.toLocaleDateString('en', { + year: 'numeric', + month: 'long', + day: 'numeric', + })}</time> + </p> + <h1>{post.data.title}</h1> + <p>{post.data.description}</p> + </header> + <div class="article-prose"> + <Content /> + </div> + </article> + </div> + </main> + + <script> + const headings = Array.from(document.querySelectorAll('.article-prose h2[id]')); + const links = new Map( + Array.from(document.querySelectorAll('[data-heading-link]')).map((link) => [ + link.getAttribute('data-heading-link'), + link, + ]), + ); + + function setActive(id) { + for (const link of links.values()) link.removeAttribute('aria-current'); + links.get(id)?.setAttribute('aria-current', 'true'); + } + + if (headings.length > 0 && links.size > 0) { + setActive(headings[0].id); + const observer = new IntersectionObserver( + (entries) => { + const visible = entries + .filter((entry) => entry.isIntersecting) + .sort((a, b) => a.boundingClientRect.top - b.boundingClientRect.top)[0]; + if (visible?.target instanceof HTMLElement) setActive(visible.target.id); + }, + { rootMargin: '-18% 0px -68% 0px', threshold: 0 }, + ); + for (const heading of headings) observer.observe(heading); + } + </script> +</MarketingLayout> diff --git a/website/src/pages/blog/index.astro b/website/src/pages/blog/index.astro new file mode 100644 index 00000000..8ca2ca10 --- /dev/null +++ b/website/src/pages/blog/index.astro @@ -0,0 +1,38 @@ +--- +import { getCollection } from 'astro:content'; +import MarketingLayout from '../../components/MarketingLayout.astro'; + +const posts = (await getCollection('blog')) + .filter((post) => !post.data.draft) + .map((post) => ({ ...post, slug: post.id.replace(/\.(md|mdx)$/i, '') })) + .sort((a, b) => b.data.date.valueOf() - a.data.date.valueOf()); +--- + +<MarketingLayout + title="Herdr blog" + description="Notes on terminal-native agent workflows and the engineering behind Herdr." + canonicalPath="/blog/" +> + <main class="content-shell"> + <section class="page-hero page-hero-compact"> + <p class="eyebrow"><span class="status-dot dot-working"></span>Blog</p> + <h1>Notes from Herdr.</h1> + <p class="hero-lede"> + Product notes and implementation writeups for the terminal-native agent multiplexer. + </p> + </section> + + <section class="section section-narrow" aria-label="Blog posts"> + <div class="post-list"> + {posts.map((post) => ( + <article class="post-card"> + <a class="post-card-link" href={`/blog/${post.slug}/`}> + <h2>{post.data.title}</h2> + <span aria-hidden="true">→</span> + </a> + </article> + ))} + </div> + </section> + </main> +</MarketingLayout> |
