Skip to content

Commit

Permalink
hugo: fix fragment link navigation setting window location
Browse files Browse the repository at this point in the history
Per proposed fixes from Jorinde.

Testing:

* Visit preview path for modules reference
* Ensure the browser URL is /docs/reference/modules/
* Scroll down to 'Resolving a package to a module'
* Click on the 'build list' link in the first sentence of the second
  paragraph
* Notice the URL updates to /docs/reference/modules/#glos-build-list
* Click the back button in the browser
* Ensure the browser URL is /docs/reference/modules/

Fixes cue-lang/cue#3615

Signed-off-by: Paul Jolly <[email protected]>
Preview-Path: /docs/reference/modules
Change-Id: Iad9488348a3d0699fad0428cf00a793f2fcd3080
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cuelang.org/+/1205727
TryBot-Result: CUEcueckoo <[email protected]>
Reviewed-by: Chief Cueckoo <[email protected]>
Reviewed-by: Jorinde <[email protected]>
  • Loading branch information
myitcv committed Dec 13, 2024
1 parent 89ecef6 commit 79f44b2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion hugo/assets/ts/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ class App {
element.addEventListener('click', (e) => {
e.preventDefault();
const target = element.getAttribute('href').replace(currentPath, '');
window.history.replaceState(null, '', target);
window.location.href = target;
scrollToHash(target);
});
});
Expand Down

0 comments on commit 79f44b2

Please sign in to comment.