diff options
author | sptaule <lecas83@gmail.com> | 2022-01-27 18:10:37 +0100 |
---|---|---|
committer | sptaule <lecas83@gmail.com> | 2022-01-27 18:10:37 +0100 |
commit | 1da8b90340235753b935a880d797cb796700d151 (patch) | |
tree | e6c98c0999eb3b58e3ebfd72b88c4379a8fa51d0 /static/js | |
parent | a8d6c4635cf4e49320ebee8ee6f348769b65ffa8 (diff) | |
download | garagehq.deuxfleurs.fr-1da8b90340235753b935a880d797cb796700d151.tar.gz garagehq.deuxfleurs.fr-1da8b90340235753b935a880d797cb796700d151.zip |
Doc refactor, doc and index QoL, fix search: working on every page
Diffstat (limited to 'static/js')
-rwxr-xr-x | static/js/site.js | 6 |
1 files changed, 4 insertions, 2 deletions
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 ( - `<a href='${item.ref}' class='group flex flex-col space-y-2 hover:bg-gray-100 p-2 rounded'>` + + `<a href='${item.ref}' class='group flex flex-col space-y-2 hover:bg-gray-100 p-2 rounded focus:outline outline-garage-orange'>` + `<h1 class='text-garage-orange font-semibold'>` + `${item.doc.title}` + `</h1>` + `<div class='content mt-2'>` + `${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; } |