Skip to content
This repository has been archived by the owner on Mar 3, 2023. It is now read-only.

Workaround trailing slashes on website #3531

Merged
merged 1 commit into from
May 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion website2/website/siteConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ const siteConfig = {
// Add custom scripts here that would be placed in <script> tags.
scripts: [
'https://buttons.github.io/buttons.js',
`${baseUrl}js/custom.js`
`${baseUrl}js/custom.js`,
`${baseUrl}js/fix-location.js`
],

// On page navigation for the current documentation page.
Expand Down
3 changes: 3 additions & 0 deletions website2/website/static/js/fix-location.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
if (window && window.location && window.location.pathname.endsWith('/') && window.location.pathname !== '/') {
window.history.replaceState('', '', window.location.pathname.substr(0, window.location.pathname.length - 1))
}