Browse Source

create 'server' variable (for search) in page and search templates.

This variable contains the URL for the Meilisearch instance this site calls out
to. It is grabbed from this site's database and passed to the Djula templates
providing Meilisearch-based features. The 'server' variable is called here so
it's easy for the dev. to see how and when it's called.
stable
Craig Oates 1 year ago
parent
commit
d8ecc23079
  1. 5
      templates/page.html
  2. 11
      templates/search.html

5
templates/page.html

@ -59,6 +59,11 @@
{{data | safe}}
</main>
<script>
let searchURL = "{{system-data.first.search-url}}";
console.log ("SEARCH URL: " + searchURL);
</script>
<script src="/js/instant-meilisearch-0.8.0.js"></script>
<script src="/js/instantsearch-4.43.1.js"></script>
<script src="/js/quick-search.js"></script>

11
templates/search.html

@ -3,7 +3,7 @@
{% block content %}
<main class="fe-main">
<div class="search-dashboard">
<div class="search-dashboard">
<div id="searchbox" class="ais-SearchBox"></div>
@ -25,10 +25,15 @@
<div id="pagination"></div>
</div>
</div>
</div>
</div>
</main>
<script>
let server = "{{system-data.first.search-url}}";
console.log ("SEARCH URL: " + server);
</script>
<script src="/js/instant-meilisearch-0.8.0.js"></script>
<script src="/js/instantsearch-4.43.1.js"></script>
<script src="/js/full-search.js"></script>

Loading…
Cancel
Save