Make navigation URL generation base-path-aware across GitHub Pages and EMU hosting#223
Conversation
| @@ -1,6 +1,5 @@ | |||
| --- | |||
| import { getEntry } from 'astro:content'; | |||
| import { dynamicConfig } from 'dynamic-astro-config'; | |||
There was a problem hiding this comment.
I removed that import because the header no longer uses dynamicConfig for URL building. It now uses import.meta.env.BASE_URL (via normalizeBasePath) so links follow Astro’s configured base path in both classic GitHub Pages and EMU hosting.
|
@copilot That worked well to remove the repo slug from the URL at the project title. It did not fix the URLs in the hamburger menu navigation. |
Fixed in |
|
@copilot That code fix still shows URLs that contain the repo name in the navigation menu. For example, in the repo Meanwhile the links on the landing page are correctly linking to |
Addressed in 44046b0. I switched the Header/Sidebar base-path source from |
Some internal links were generated by prepending the repository slug, which works for classic
github.io/<repo>project pages but breaks when Pages is hosted under a different base path (including EMU setups). This change makes link generation consistently respect the configured Astro base path instead of assuming slug-based hosting.Base-path normalization
/), not fromproject.slug.//and missing separators.Header / home link
Navigation routes (pages/events/tags)
pages,events, andtagsremain correct in both hosting models.