Pages and routing

Create a page from Markdown

Use Markdown for content that maps directly to a route and choose content collections when many entries share one content model.

8 minute lesson

~~~

A Markdown file under src/pages/ becomes a route.

---
title: Installation
description: Install the project locally.
---

# Installation

Run the project wizard, then start the development server.

At build time, Astro turns the Markdown into HTML. The frontmatter values are available to the page and any configured layout; they are not sent as a JavaScript object to the browser by default.

Direct Markdown pages are convenient for a few standalone documents whose file path is their URL.

Use a content collection when many posts, notes, or docs share one model. Collections add a schema, query API, and a clear place to create dynamic routes from entries.

Markdown does not remove the need for semantic structure. Use one clear main heading, descriptive links, accurate image text, and a layout that supplies document metadata.

Create one Markdown page and inspect its generated HTML. Then break a required layout value and see whether your current setup catches it.

Lesson completed

Take this course offline

Get every free book and course as PDF and EPUB files.

Get the download library →