Ship Your First Astro Site
From zero to a deployed static site in 45 minutes — content collections, islands, and the mental model that makes Astro click.
Why Astro
Astro ships zero JavaScript by default. Your content renders to plain HTML on the server, and interactive islands hydrate only where you ask for it. For a content-heavy personal site — blog, research, galleries — that is exactly the trade you want.
The 45-minute path
Scaffold the project
npm create astro@latestPick the blog template and TypeScript strict mode. cd into the folder.
Define a content collection
In src/content.config.ts, declare a blog collection with a zod schema — title, date, locale. Every .mdx file is now type-checked at build time.
Write your first post
Drop a .mdx file under src/content/blog/en/hello.mdx with the frontmatter your schema expects. The dev server hot-reloads it.
You should see the post listed on http://localhost:4321/blog — and a red zod error if frontmatter is missing a required field.
Add a dynamic route
Create src/pages/blog/[slug].astro exporting getStaticPaths() and calling render(entry) for the body.
Deploy
npm run build produces a fully static dist/ — host it on Vercel, Netlify, Cloudflare Pages, or a $3 VPS behind nginx.
Islands: the part people miss
<Hero client:load /> <!-- hydrates immediately -->
<Chart client:visible /> <!-- hydrates when scrolled into view -->
<Comments client:idle /> <!-- hydrates when the browser is idle -->
Reach for client:visible on anything below the fold. Your Lighthouse score will thank you.
What’s next
Add i18n with [locale] dynamic routes — covered in the i18n tutorial.
