Skip to content

Commit

Permalink
fix: likely fix for routing issue from .html pages
Browse files Browse the repository at this point in the history
  • Loading branch information
Bobinstein committed Sep 9, 2024
1 parent 7ec658f commit 6804014
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions docs/src/.vuepress/enhanceApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,17 @@ export default ({
if (redirectPath && isStaging) {
redirectPath = `/docs${redirectPath}`;
}

// Specific handling for `.html` pages to force a reload
if (normalizedPath.endsWith('.html') && redirectPath) {
window.location.href = redirectPath + (to.hash || '');
return; // Ensure further navigation is prevented after reload
}
}

if (redirectPath) {
// Use router.push to ensure Vue Router handles the navigation properly
// router.push({ path: redirectPath, hash: to.hash });
window.location.replace(redirectPath)
// For regular non-`.html` redirects
window.location.replace(redirectPath + (to.hash || ''));
} else {
next(); // Proceed to the requested page if no redirect is found
}
Expand Down

0 comments on commit 6804014

Please sign in to comment.