Skip to content
Snippets Groups Projects
Commit 9f2af687 authored by Uwe Jandt (DESY, HIFIS)'s avatar Uwe Jandt (DESY, HIFIS)
Browse files

Merge branch 'fix-bug-paths-for-search-js' into 'master'

Fix bug in paths replacement for search js

See merge request !308
parents e8f70aac cf92fd52
No related branches found
No related tags found
1 merge request!308Fix bug in paths replacement for search js
......@@ -35,6 +35,9 @@ header:
- title: Jobs <i class="fas fa-bell"></i>
url: "job_offers.html"
- title: <i class="fas fa-search"></i>
url: "search.html"
footer:
- title: Contact
url: "contact.html"
......
---
---
{% if site.baseurl != '/' %}
{% assign base_url = site.baseurl %}
{% else %}
{% assign base_url = '' %}
{% endif %}
[
{% for post in site.posts %}
{
"title" : "{{ post.title | escape }}",
"url" : "{{ site.baseurl }}{{ post.url }}",
"url" : "{{ base_url }}{{ post.url }}",
"category" : "{{ post.category }}",
"tags" : "{{ post.tags | join: ', ' }}",
"date" : "{{ post.date }}",
......@@ -20,7 +25,7 @@
"title" : "{{ page.title | escape }}",
"category" : "{{ page.category }}",
"tags" : "{{ page.tags | join: ', ' }}",
"url" : "{{ site.baseurl }}{{ page.url }}",
"url" : "{{ base_url }}{{ page.url }}",
"date" : "{{ page.date }}",
"content" : "{{ page.content | strip_html | strip_newlines | remove_chars | escape }}"
{% endif %}
......
......@@ -6,6 +6,12 @@ excerpt:
Search in hifis.net
---
{% if site.baseurl != '/' %}
{% assign base_url = site.baseurl %}
{% else %}
{% assign base_url = '' %}
{% endif %}
# Search in hifis.net
{:.text-success}
......@@ -18,13 +24,13 @@ Maximum number of results shown is 20.
<ul id="results-container"></ul>
</div>
<script src="{{ site.baseurl }}/js/simple-jekyll-search.js"></script>
<script src="{{ base_url }}/js/simple-jekyll-search.js"></script>
<script>
window.simpleJekyllSearch = new SimpleJekyllSearch({
searchInput: document.getElementById('search-input'),
resultsContainer: document.getElementById('results-container'),
json: '{{ site.baseurl }}/search.json',
json: '{{ base_url }}/search.json',
searchResultTemplate: '<li><a href="{url}?query={query}" title="{desc}">{title}</a></li>',
noResultsText: 'No results found',
limit: 20,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment