← 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
- Check if path matches existing curated routes → serve normally
- If not found, check content directory for exact path match
- If found, serve content with appropriate layout
- If still not found, check for redirects/aliases
- Finally, show 404 with suggestions
Note: more specific and longer path resolutions get priority in Astro, which may be counterintuitive to some.