Blog posts
Add a .md or .mdx file to src/content/blog/. The filename becomes the URL slug.
---title: 'My new post'description: 'One or two sentences used in cards, SEO, and the RSS feed.'publishedAt: 2026-08-01tags: ['TypeScript', 'Web']category: 'Engineering'image: './images/my-post.png' # optional coverfeatured: falsedraft: false---
Your content here.Schema notes:
publishedAtis required;updatedAtis optional and shown when presentfeatured: truesurfaces the post on the homepagedraft: truehides the post from production builds but keeps it visible in devimage(optional) is the cover. See Images below- Reading time is computed automatically, nothing to declare
Images
Put images next to your content and reference them with a relative path. The build resizes them, converts them to WebP, and emits a srcset, so a 2MB screenshot never reaches a visitor:
src/content/├── blog/│ ├── my-post.mdx│ └── images/my-post.png ← image: './images/my-post.png'└── projects/ ├── my-tool.md └── images/my-tool.png ← image: './images/my-tool.png'- Blog
imageis the cover at the top of the post and the social (Open Graph) image. Aim for 1400×740 or any ~1.9:1 crop. - Project
imageis the card thumbnail and the hero on the project page. Use 16:9 (e.g. 1280×720). - Images inside the markdown body (
) are optimized the same way. - Animated GIFs and SVGs are passed through untouched.
Files in public/ are served as-is with no optimization. Use that folder only for the favicon and avatar.
Open Graph images
Every post and project gets a generated 1200×630 social card at build time (title, description, category, and your site name on the dark theme), served from /og/blog/<slug>.png and /og/projects/<slug>.png. Pages without their own card (home, about, docs) use /og/default.png, built from your hero tagline.
A post or project that sets image uses that image for social previews instead. Change the design in src/lib/og.ts.
Projects
Add a file to src/content/projects/:
---title: 'My Tool'description: 'What it is, in one sentence.'image: './images/my-tool.png'technologies: ['TypeScript', 'Node.js']github: 'https://github.com/you/my-tool'demo: 'https://my-tool.example.com'status: 'active' # active | maintained | archived | in-progressyear: 2026featured: true---
## Overview...The body supports the same markdown features as blog posts. A common structure: Overview → Technology stack → Challenges → Results.
Docs pages
Add files to src/content/docs/. Sidebar structure comes from frontmatter, not folders:
---title: 'My guide'group: 'Guides' # sidebar section headingorder: 30 # position (sorted ascending, globally)---Subfolders are fine and become part of the URL (docs/customization/theming.md → /docs/customization/theming).
MDX
Use the .mdx extension when you need components. Callout and Tabs are pre-wired in all three collections, no imports needed:
<Callout type="warning">Careful with this one.</Callout>
<Tabs tabs={['npm', 'pnpm']}> <div>
```bashnpm install astropnpm add astroKeep the blank lines around fenced code inside <Tabs>. MDX needs them to switch back to markdown mode.
Links
External links in content (https://…) automatically open in a new tab with rel="noopener noreferrer". Internal links stay root-relative (/blog/my-post) and are rewritten for subpath deploys at build time. Both are handled by the markdown pipeline in astro.config.ts.
Drafts
Set draft: true on any post, project, or doc. Drafts render in npm run dev so you can preview them, and are excluded from npm run build.