From 94d40ef18af40426a4a326f70370e781043aa883 Mon Sep 17 00:00:00 2001 From: Jerad Rutnam Date: Thu, 26 Sep 2024 20:28:55 +0530 Subject: [PATCH 1/2] Add trailing slash fix to base.html template --- en/theme/material/assets/js/theme.js | 8 -------- en/theme/material/partials/javascripts/base.html | 10 ++++++++++ 2 files changed, 10 insertions(+), 8 deletions(-) create mode 100644 en/theme/material/partials/javascripts/base.html diff --git a/en/theme/material/assets/js/theme.js b/en/theme/material/assets/js/theme.js index 5d8dc70160..9a4a8b5e6f 100644 --- a/en/theme/material/assets/js/theme.js +++ b/en/theme/material/assets/js/theme.js @@ -34,11 +34,3 @@ dropdownLink.addEventListener('click', function(event) { event.stopPropagation(); // Prevent the event from propagating to the document 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); - } -}); diff --git a/en/theme/material/partials/javascripts/base.html b/en/theme/material/partials/javascripts/base.html new file mode 100644 index 0000000000..ca031ab4e9 --- /dev/null +++ b/en/theme/material/partials/javascripts/base.html @@ -0,0 +1,10 @@ + + \ No newline at end of file From 4ada12428891431c5521ead3b0e4cac01f771ca8 Mon Sep 17 00:00:00 2001 From: Jerad Rutnam Date: Thu, 26 Sep 2024 20:31:05 +0530 Subject: [PATCH 2/2] Add missing new line to EOF en/theme/material/partials/javascripts/base.html --- en/theme/material/partials/javascripts/base.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/en/theme/material/partials/javascripts/base.html b/en/theme/material/partials/javascripts/base.html index ca031ab4e9..740e1a08c7 100644 --- a/en/theme/material/partials/javascripts/base.html +++ b/en/theme/material/partials/javascripts/base.html @@ -7,4 +7,4 @@ window.history.replaceState({}, document.title, newPath); } }); - \ No newline at end of file +