Skip to content

Fix nav URL rebasing to work across pages at different depths#206

Open
gpx1000 wants to merge 1 commit intoKhronosGroup:mainfrom
gpx1000:fix-source-duplicate-dir
Open

Fix nav URL rebasing to work across pages at different depths#206
gpx1000 wants to merge 1 commit intoKhronosGroup:mainfrom
gpx1000:fix-source-duplicate-dir

Conversation

@gpx1000
Copy link
Copy Markdown
Collaborator

@gpx1000 gpx1000 commented May 9, 2026

Rewrites captured nav hrefs/src to be component-root-relative instead of page-relative. The shared nav loader now accepts a per-page prefix that adjusts URLs back to each page's URL space, preventing duplication bugs like /source/source/ when nested pages reference the same shared nav.

Rewrites captured nav hrefs/src to be component-root-relative instead of page-relative. The shared nav loader now accepts a per-page prefix that adjusts URLs back to each page's URL space, preventing duplication bugs like `/source/source/` when nested pages reference the same shared nav.
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 9, 2026

Preview site published: https://KhronosGroup.github.io/Vulkan-Site/PR-206/

@gpx1000
Copy link
Copy Markdown
Collaborator Author

gpx1000 commented May 9, 2026

Okay that looks fixed. NB: due to the issues of how we make the PR pages work this is the way to test it:
1.) browse to refpages from the top level
2.) select any ref page from the left pane
3.) hit the back button on your browser
4.) select any other ref page
5.) repeat until you are comfortable that this is the fix.

Technical reason for why this is necessary: The way the PR pages are made small is they reuse sites that have not changed that are served in the base main branch. A correllary of that effect is you need have PR-206 in your address bar when the site is loaded so that it resolves the javascript that is fixed rather than the broken code in main.

Advantage of this work around issue, you can validate after navigating to another page that is served on the main site, you can validate that it is broken on main then hitting the back button to get to the PR preview site that same link will resolve correctly.

@gpx1000 gpx1000 mentioned this pull request May 9, 2026
@SaschaWillems
Copy link
Copy Markdown
Collaborator

The review page linked by the github bot above still has the issue. Or is there another easy way to test?

@gpx1000
Copy link
Copy Markdown
Collaborator Author

gpx1000 commented May 10, 2026

Could you give me repo steps?

@SaschaWillems
Copy link
Copy Markdown
Collaborator

SaschaWillems commented May 10, 2026

With above link (https://KhronosGroup.github.io/Vulkan-Site/PR-206/) navigate to e.g. https://github.khronos.org/Vulkan-Site/refpages/latest/refpages/source/VK_VERSION_1_4.html

Links in nav will have a duplicate "source" added to their url afterwards.

I've attached a video:

brave_EeyffCYblw.mp4

@oddhack
Copy link
Copy Markdown
Collaborator

oddhack commented May 10, 2026

EDIT: cancel comment, I was looking at the wrong zipfile contents. The latest CI artifact does not seem to have this problem.

---- old comment ----

I pulled the latest artifacts from the PR and viewed locally to reproduce the publication environment, rather than dealing with how the GH preview pages are setup. Can confirm that the nav index is still broken. Starting at refpages/latest/refpages/index.html I can navigate to arbitrary refpages from the sidebar, but from such a new refpage, the nav index is then broken with the 'source/source/' showing up again.

@gpx1000
Copy link
Copy Markdown
Collaborator Author

gpx1000 commented May 10, 2026

Thanks, working on finding this now.

@oddhack
Copy link
Copy Markdown
Collaborator

oddhack commented May 10, 2026

Thanks, working on finding this now.

Sorry, I withdraw the comment. Was looking at the wrong artifact contents.

@gpx1000
Copy link
Copy Markdown
Collaborator Author

gpx1000 commented May 10, 2026

Phew, I was looking for the bug and couldn't find it

@oddhack
Copy link
Copy Markdown
Collaborator

oddhack commented May 10, 2026

@gpx1000 @SaschaWillems I want to go ahead and merge this and #207 because they both fix basic wrong things and I don't want to wait until next week's docs call to do another site update. If you object to that please speak up soon.

The behavior @SaschaWillems describes above is AFAICT an artifact of how the preview site is trying to remove duplicates and expected - the first click on the PR-206 nav index correctly resolves to a refpage, but the refpage it resolves to is from main branch CI, not this branch, so it's expected it would then fail. It does not happen locally and should not on docs.vulkan.org, though I will check that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Broken links in sidebar: Redundant "/source/" segment in extension URLs

3 participants