Astro · Routing and content
Generate dynamic pages at build time
getStaticPaths lists the values for a dynamic route in a static site.
---
export function getStaticPaths() {
return [
{ params: { slug: "first" }, props: { title: "First post" } },
{ params: { slug: "second" }, props: { title: "Second post" } },
];
}
const { title } = Astro.props;
---
<h1>{title}</h1>