Skip to content
This repository has been archived by the owner on Dec 6, 2022. It is now read-only.

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 authored and Jakub Pogorzelski committed Feb 11, 2019
1 parent c6cede7 commit d910f33
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 d910f33

Please sign in to comment.