--- // src/content/config.ts import { defineCollection, z } from 'astro:content'; const blog = defineCollection({ type: 'content', schema: z.object({ title: z.string(), publishDate: z.date(), }), }); export const collections = { blog }; --- title: Zero JS by Default publishDate: 2026-08-01 --- Astro ships static HTML unless a component explicitly opts into hydration via a client directive. --- title: Islands Explained publishDate: 2026-08-03 --- Each interactive island hydrates independently, on its own schedule. --- // src/layouts/BaseLayout.astro interface Props { title: string; } const { title } = Astro.props; --- {title} --- // src/pages/blog/index.astro import BaseLayout from '../../layouts/BaseLayout.astro'; import { getCollection } from 'astro:content'; const posts = await getCollection('blog'); --- --- // src/pages/blog/[slug].astro import BaseLayout from '../../layouts/BaseLayout.astro'; import { getCollection } from 'astro:content'; export async function getStaticPaths() { const posts = await getCollection('blog'); return posts.map((post) => ({ params: { slug: post.slug }, props: { post }, })); } const { post } = Astro.props; const { Content } = await post.render(); ---

{post.data.title}