diff options
| author | Mirek Kratochvil <miroslav.kratochvil@uni.lu> | 2023-10-16 19:04:10 +0200 |
|---|---|---|
| committer | Mirek Kratochvil <miroslav.kratochvil@uni.lu> | 2023-10-16 19:04:10 +0200 |
| commit | 56dcda56193d0148af8868d81247010c0d0b8db3 (patch) | |
| tree | d896ea5fb83a4e088783a8d055740c8f5de402c5 | |
| parent | 7fa8225d8063e3b98b98ba007a78c2892ac4f017 (diff) | |
| download | reploy-56dcda56193d0148af8868d81247010c0d0b8db3.tar.gz reploy-56dcda56193d0148af8868d81247010c0d0b8db3.tar.bz2 | |
do not use root in templates directly (in favor of rawRootUrl)
| -rw-r--r-- | templates/searchform.html | 2 | ||||
| -rw-r--r-- | templates/searchresults.html | 10 |
2 files changed, 6 insertions, 6 deletions
diff --git a/templates/searchform.html b/templates/searchform.html index 2b4da9d..ddbb468 100644 --- a/templates/searchform.html +++ b/templates/searchform.html @@ -1,3 +1,3 @@ -<form action="{{root}}search/"> +<form action="{{#rawRootUrl}}search{{/rawRootUrl}}"> <input name="search_query" id="search_query" /> </form> diff --git a/templates/searchresults.html b/templates/searchresults.html index 0077c73..568f963 100644 --- a/templates/searchresults.html +++ b/templates/searchresults.html @@ -1,5 +1,5 @@ -<link rel="prefetch" href="{{root}}search-index.json" /> -<link rel="prefetch" href="{{root}}search-metadata.json" /> +<link rel="prefetch" href="{{#rawRootUrl}}search-index.json{{/rawRootUrl}}" /> +<link rel="prefetch" href="{{#rawRootUrl}}search-metadata.json{{/rawRootUrl}}" /> <div id="search_placeholder"> <p>Search is loading. If you cannot see any results after a few seconds, check that JavaScript is enabled in your browser.</p> @@ -28,7 +28,7 @@ <p>The error description is: <span style="color: red" id="search_error_text"></span></p> </div> -<script src="{{root}}static/lunr.min.js"></script> +<script src="{{#rawRootUrl}}static/lunr.min.js{{/rawRootUrl}}"></script> <script> lunr.QueryLexer.termSeparator = /(\p{P}|\p{S}|\p{Z}|\p{C})+/u; @@ -117,10 +117,10 @@ } Promise.all([ - fetch('{{root}}search-index.json').then(response => response.text()).then(text => { + fetch('{{#rawRootUrl}}search-index.json{{/rawRootUrl}}').then(response => response.text()).then(text => { window.search_index = lunr.Index.load(JSON.parse(text)) }), - fetch('{{root}}search-metadata.json').then(response => response.text()).then(text => { + fetch('{{#rawRootUrl}}search-metadata.json{{/rawRootUrl}}').then(response => response.text()).then(text => { window.search_metadata = JSON.parse(text) }) ]).then(() => { |
