Skip to main content

Static Sites on GitHub Pages

Posted on: July 7, 2026  at  04:10 AM
Engineering

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 basePath and assetPrefix for the repository path.
  • Avoid server routes and runtime-only data fetching.
  • Generate sitemap.xml before the build.
  • Add .nojekyll to the exported output.

The result is boring in the best way: a static directory that GitHub Pages can host without any server process.