This is an automated email from the ASF dual-hosted git repository.
nwang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-heron.git
The following commit(s) were added to refs/heads/master by this push:
new e06dc8f Workaround trailing slashes on website (#3531)
e06dc8f is described below
commit e06dc8ff67bae7ff81abe8a0693ca0a25e9266d6
Author: Oliver Bristow <[email protected]>
AuthorDate: Fri May 29 04:49:56 2020 +0100
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:
https://github.com/facebook/docusaurus/issues/2394
---
website2/website/siteConfig.js | 3 ++-
website2/website/static/js/fix-location.js | 3 +++
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/website2/website/siteConfig.js b/website2/website/siteConfig.js
index 9651231..e8fa9c9 100644
--- a/website2/website/siteConfig.js
+++ b/website2/website/siteConfig.js
@@ -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.
diff --git a/website2/website/static/js/fix-location.js
b/website2/website/static/js/fix-location.js
new file mode 100644
index 0000000..3afb430
--- /dev/null
+++ b/website2/website/static/js/fix-location.js
@@ -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))
+}