← Corpus / lost-in-public / reminder

How to manage gnarly routing with Static Site Generators

Guidlines for how to manage dynamic and static routing with Static Site Generators

Path
reminders/Gnarly-Routing-with-Static-Site-Generators.md
Authors
Michael Staton
Augmented with
Windsurf Cascade on SWE-1
Tags
Dynamic-Routing · Route-Mapping · Static-Site-Generators

Pseudo-code for route resolution

  1. Check if path matches existing curated routes → serve normally
  2. If not found, check content directory for exact path match
  3. If found, serve content with appropriate layout
  4. If still not found, check for redirects/aliases
  5. Finally, show 404 with suggestions

Note: more specific and longer path resolutions get priority in Astro, which may be counterintuitive to some.