From 1da8b90340235753b935a880d797cb796700d151 Mon Sep 17 00:00:00 2001 From: sptaule Date: Thu, 27 Jan 2022 18:10:37 +0100 Subject: Doc refactor, doc and index QoL, fix search: working on every page --- static/js/site.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'static/js') diff --git a/static/js/site.js b/static/js/site.js index f764289..d8e0d69 100755 --- a/static/js/site.js +++ b/static/js/site.js @@ -112,7 +112,7 @@ function makeTeaser(body, terms) { function formatSearchResultItem(item, terms) { return ( - `` + + `` + `

` + `${item.doc.title}` + `

` + `
` + `${makeTeaser(item.doc.body, terms)}` + @@ -168,9 +168,11 @@ function search() { } function openSearchModal() { + var baseUrl = window.location.protocol + "//" + window.location.host; + var indexScriptPath = baseUrl + '/search_index.en.js'; if (indexScriptLoaded === false) { var indexScript = document.createElement('script'); - indexScript.setAttribute('src', './search_index.en.js'); + indexScript.setAttribute('src', indexScriptPath); document.head.appendChild(indexScript); indexScriptLoaded = true; } -- cgit v1.2.3