Only load Lunr languages that exist in theme
ref: https://github.com/mmistakes/minimal-mistakes/pull/1445#issuecomment-355153434
This commit is contained in:
parent
27d6774b25
commit
70ad1c2d8c
1 changed files with 7 additions and 1 deletions
|
@ -11,8 +11,14 @@
|
||||||
<script src="{{ '/assets/js/main.min.js' | absolute_url }}"></script>
|
<script src="{{ '/assets/js/main.min.js' | absolute_url }}"></script>
|
||||||
{% endif %}
|
{% 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" %}
|
{% 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.min.js' | absolute_url }}"></script>
|
||||||
<script src="{{ '/assets/js/lunr-' | append: lang | append: '.js' | absolute_url }}"></script>
|
<script src="{{ '/assets/js/lunr-' | append: lang | append: '.js' | absolute_url }}"></script>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
Loading…
Reference in a new issue