Skip to main content
Every .html file in client/pages/ becomes a route automatically. There is no router configuration — the file system is the router. For dynamic content, export getStaticPaths() to tell Aero which URLs to generate at build time.

Static pages

Drop an .html file in client/pages/ and Aero turns it into a URL:
FileURLBuild output
client/pages/index.html/dist/index.html
client/pages/about.html/aboutdist/about/index.html
client/pages/docs/index.html/docsdist/docs/index.html
client/pages/404.html(404 page)dist/404.html
Subdirectories map to URL segments. Place an index.html inside a directory to serve that segment’s root.

Dynamic routes

Bracket-delimited filenames create dynamic routes. The bracket content becomes the parameter name:
FilePatternExample URLs
client/pages/[id].html/:id/alpha, /beta
client/pages/docs/[slug].html/docs/:slug/docs/intro
In dev, dynamic routes resolve at request time. For static builds, you must export getStaticPaths().

getStaticPaths

Export getStaticPaths() from <script is:build> to tell Aero which paths to generate:
client/pages/[id].html
<script is:build>
	import base from '@layouts/base'

	export function getStaticPaths() {
		return [{ params: { id: 'alpha' } }, { params: { id: 'beta' } }]
	}
</script>

<base-layout>
	<h1>{ Aero.page.params.id }</h1>
</base-layout>
getStaticPaths can be async for fetching from APIs or content collections at build time.
If a dynamic page does not export getStaticPaths, it is skipped during build with a warning. The page still works in dev but produces no output files.

Template context

Inside build scripts and expressions, every page has access to:
ValueDescription
Aero.page.paramsDynamic route parameters (e.g. { id: 'alpha' })
Aero.page.urlFull URL object for the current page
Aero.page.url.pathnameThe URL path (e.g. '/alpha')

Linking between pages

Use standard <a href> tags with absolute paths:
<a href="/">Home</a> <a href="/about">About</a>
Aero rewrites absolute href values to relative paths during build so your site works at any base path.