Skip to content
Wei Li
Go back

Getting Started with Astro: Pages, Posts, and First Impressions

Edit page

This blog started out as the project from Astro’s official tutorial. These are my notes from that first stretch: what I built, why I picked Astro, and what tripped me up along the way.

What I built first

  1. Installing Astro: First, I created a new Astro project and set up my online accounts.
  2. Making Pages: I then learned how to make pages by creating new .astro files and placing them in the src/pages/ folder.
  3. Making Blog Posts: I wrote my first posts as Markdown files, which Astro turns into pages. This post started out as one of them.

It was honestly a little surreal to see a page I built myself show up in a real browser. A few weeks earlier I couldn’t have told you the difference between a static site and a server-rendered one, and by the end of the tutorial I had navigation, a footer, and even a dark mode toggle. Small wins, but they add up fast.

The Astro logo on a dark background with a purple gradient arc.

Why I picked Astro

I looked at a few frameworks before landing here. What sold me was the “islands” idea — most of the page ships as plain HTML, and only the bits that actually need JavaScript (like a button that changes state) get hydrated in the browser. Everything else stays server-rendered and fast.

If you can write HTML, you can write Astro components!

That line from Why Astro? is roughly how I’d explain it to my past self.

A quick taste of what a component’s frontmatter looks like:

---
const pageTitle = "About Me";
const skills = ["HTML", "CSS", "JavaScript"];
---

<h1>{pageTitle}</h1>
<ul>
  {skills.map(skill => (
    <li>{skill}</li>
  ))}
</ul>

That’s it — a fenced code block at the top for logic, then plain HTML-ish markup below it. No separate templating language to learn, no build step surprises.

Things that tripped me up

Nothing was too painful, but a few things took a second read of the docs:

The Astro logo on a dark background with rainbow rays.

Where it went next

Since finishing the tutorial, I’ve moved this site onto the AstroPaper theme and added support for writing posts in AsciiDoc, which I cover in Writing Blog Posts in AsciiDoc.

If you’re following along and building your own site, my one piece of advice is: don’t skip the “why” sections in the docs. It’s tempting to just copy-paste the code blocks, but the parts explaining why Astro made a particular choice are what made the rest of it click for me.


Edit page
Share this post:

Next Post
Writing Blog Posts in AsciiDoc