toolbox · framework
Astro
The static site generator behind the Library.
Install
npm install astronpx astro --versionWhat it is
Astro is a static site generator: it turns files into HTML at build time and ships no JavaScript unless a component asks to run in the browser.
How it works
src/pages/maps files to URLs.index.astrois/, andlibrary/[...slug].astrois a dynamic route..astrocomponents have a frontmatter block (build-time JavaScript) and a template.- Content collections load Markdown from a folder, validate front matter with Zod and give
typed entries to
getCollection()andrender(). output: "static"writes plain files todist/, which is exactly what Pages serves.
In this project
The Library uses Astro with two collections (library, notes) plus toolbox. The shared
header and footer are injected in src/layouts/Base.astro, and tags, RSS and the sitemap are
generated from the same content.
Gotchas
- Astro 7 needs Node 22.23 or newer.
dist/is generated. Editsrc/, never the output.- A page with no frontmatter fence is just a template; anything that reads files must be in the fence.