Static Sites on GitHub Pages
Posted on: July 7, 2026 at 04:10 AM
GitHub Pages project sites are served from a subpath like
/decadez.dev. Static Next.js sites need to know that path at build time.
Checklist
- Use static export output.
- Set
basePathandassetPrefixfor the repository path. - Avoid server routes and runtime-only data fetching.
- Generate
sitemap.xmlbefore the build. - Add
.nojekyllto the exported output.
The result is boring in the best way: a static directory that GitHub Pages can host without any server process.