Skip to content

Commit

Permalink
Only load Lunr languages that exist in theme
Browse files Browse the repository at this point in the history
  • Loading branch information
mmistakes committed Jan 4, 2018
1 parent 3f8425a commit f629ce9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion _includes/scripts.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,14 @@
<script src="{{ '/assets/js/main.min.js' | absolute_url }}"></script>
{% endif %}

{% if site.search == true or page.layout == 'search' %}
{% if site.search == true or page.layout == "search" %}
{% assign lang = site.locale | slice: 0,2 | default: "en" %}
{% case lang %}
{% when "gr" %}
{% assign lang = "gr" %}
{% else %}
{% assign lang = "en" %}
{% endcase %}
<script src="{{ '/assets/js/lunr.min.js' | absolute_url }}"></script>
<script src="{{ '/assets/js/lunr-' | append: lang | append: '.js' | absolute_url }}"></script>
{% endif %}
Expand Down

0 comments on commit f629ce9

Please sign in to comment.