Skip to content

Commit

Permalink
Merge pull request #4784 from jeradrutnam/master
Browse files Browse the repository at this point in the history
Add a test solution for URL trailing slash issue
  • Loading branch information
jeradrutnam authored Sep 26, 2024
2 parents 33b9058 + c7ef6bc commit e8aede5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 2 additions & 2 deletions en/asgardeo/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ INHERIT: ../base.yml
# Project information
site_name: &site_name Asgardeo
site_description: Asgardeo Learning Center
site_url: &site_url https://wso2.com/asgardeo/docs
site_url: https://wso2.com/asgardeo/docs

# Configuration
theme:
Expand All @@ -29,7 +29,7 @@ theme:
favicon: assets/images/asgardeo-favicon.svg

extra:
base_path: *site_url
base_path: /asgardeo/docs
product: asgardeo
product_name: *site_name
nav_list:
Expand Down
8 changes: 7 additions & 1 deletion en/theme/material/assets/js/theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,10 @@ dropdownLink.addEventListener('click', function(event) {
dropdown.classList.toggle('open'); // Toggle the "open" class
});


document.addEventListener('DOMContentLoaded', function () {
// Check if the path does not end with a slash and has no file extension
if (!window.location.pathname.endsWith('/') && !window.location.pathname.split('/').pop().includes('.')) {
var newPath = window.location.pathname + '/' + window.location.search + window.location.hash;
window.history.replaceState({}, document.title, newPath);
}
});

0 comments on commit e8aede5

Please sign in to comment.