Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/chipzoller/hugo-clarity.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Boothe <git@rootwork.org>2022-06-11 01:00:31 +0300
committerIvan Boothe <git@rootwork.org>2022-06-11 01:00:31 +0300
commit0efdd7a84ae133b71bf1daa12cc09c6dfe4c7824 (patch)
tree4231947fa687532e9e36b9779965bab7668562e8
parent1b25c19462fe8bf1c02148cf18291648ffa35791 (diff)
Modify search URLs to allow for baseURL subdirsbaseurl-fixes
Signed-off-by: Ivan Boothe <git@rootwork.org>
-rw-r--r--assets/js/search.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/assets/js/search.js b/assets/js/search.js
index 2352a88..577e270 100644
--- a/assets/js/search.js
+++ b/assets/js/search.js
@@ -124,7 +124,7 @@ function initializeSearch(index) {
const searchTerm = searchField.value.trim().toLowerCase();
if(searchTerm.length) {
const scopeParameter = searchScope ? `&scope=${searchScope}` : '';
- window.location.href = new URL(`search/?query=${searchTerm}${ scopeParameter }`, baseURL).href;
+ window.location.href = new URL(baseURL + `search/?query=${searchTerm}${ scopeParameter }`).href;
}
});
}
@@ -211,7 +211,7 @@ function initializeSearch(index) {
window.addEventListener('load', function() {
const pageLanguage = document.documentElement.lang;
const searchIndex = `${ pageLanguage === 'en' ? '': pageLanguage}/index.json`;
- fetch(new URL(searchIndex, baseURL).href)
+ fetch(new URL(baseURL + searchIndex).href)
.then(response => response.json())
.then(function(data) {
data = data.length ? data : [];