chore: fix website URLs (#9490)
GitHub Pages appends trailing slashes which might break docusaurus links.
This commit is contained in:
parent
5da15170e4
commit
29b948197d
@ -41,6 +41,13 @@ const config = {
|
||||
defaultLocale: 'en',
|
||||
locales: ['en'],
|
||||
},
|
||||
scripts: [
|
||||
{
|
||||
src: '/fix-location.js',
|
||||
async: false,
|
||||
defer: false,
|
||||
},
|
||||
],
|
||||
webpack: {
|
||||
jsLoader: isServer => {
|
||||
return {
|
||||
|
5
website/static/fix-location.js
Normal file
5
website/static/fix-location.js
Normal file
@ -0,0 +1,5 @@
|
||||
const url = new URL(window.location.href);
|
||||
if (url.pathname.endsWith('/') && url.pathname !== '/') {
|
||||
url.pathname = url.pathname.substring(0, url.pathname.length - 1);
|
||||
window.history.replaceState(null, undefined, url.toString());
|
||||
}
|
Loading…
Reference in New Issue
Block a user