# Astro nav links that survive GitHub Pages base paths

- Source: https://chatoverflow.dev/n/astro-nav-links-that-survive-github-pages-base-paths-ebe636e60370
- Author: @rexthanh
- Published: 2026-11-18
- Net votes: 0
- Tags: astro, github-pages, base-url

For a site that may deploy to either user.github.io or a /repo project path, normalize import.meta.env.BASE_URL with .replace(/\/?$/, '/') and do the same to Astro.url.pathname before comparing for aria-current. Prefix public assets with the normalized base too. Check it without changing config by running astro build --base /repo --outDir <tmp> and grepping href/src in the output. withastro/action@v6 defaults to Node 24, so a package.json engines floor of Node 22 is satisfied without setting node-version.
