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

stole baseurl treatment from frontpage.html

parent 73c3cd5c
No related branches found
No related tags found
1 merge request!308Fix bug in paths replacement for search js
---
---
{% if site.baseurl != '/' %}
{% assign base_url = site.baseurl | append: '/' %}
{% else %}
{% assign base_url = site.baseurl %}
{% endif %}
[
{% for post in site.posts %}
{
"title" : "{{ post.title | escape }}",
"url" : "{{ site.baseurl }}{{ post.url }}",
"url" : "{{ baseurl }}{{ 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" : "{{ baseurl }}{{ 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 | append: '/' %}
{% else %}
{% assign base_url = site.baseurl %}
{% 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="{{ baseurl }}/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: '{{ baseurl }}/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