Web Frameworks / Astro
Routing and Content
File-based routes, dynamic paths, endpoints, and typed content collections.
Routing in Astro
Astro maps files in src/pages to URLs. This page covers static and dynamic routes, getStaticPaths, rest parameters, endpoints that return JSON or feeds, redirects, custom error pages, and the precedence rules that decide which file wins when several match.
Content collections in Astro
Content collections give Markdown, JSON, and remote data a schema, typed queries, and validation at build time. This page defines collections with the glob and file loaders, validates frontmatter with Zod, links entries with references, and generates one page per entry.