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

Commit e06dc8f

Browse files
authored
Workaround trailing slashes on website (#3531)
This is as the website deployment 301s to add trailing slashes, and Docusurus does not yet support that. Without one of the two yielding, this workaround strips the trailing slash so the hrefs made still work. Solution pinched from docusurus issue: facebook/docusaurus#2394
1 parent c713f43 commit e06dc8f

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

website2/website/siteConfig.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,8 @@ const siteConfig = {
110110
// Add custom scripts here that would be placed in <script> tags.
111111
scripts: [
112112
'https://buttons.github.io/buttons.js',
113-
`${baseUrl}js/custom.js`
113+
`${baseUrl}js/custom.js`,
114+
`${baseUrl}js/fix-location.js`
114115
],
115116

116117
// On page navigation for the current documentation page.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
if (window && window.location && window.location.pathname.endsWith('/') && window.location.pathname !== '/') {
2+
window.history.replaceState('', '', window.location.pathname.substr(0, window.location.pathname.length - 1))
3+
}

0 commit comments

Comments
 (0)