Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/reuixiy/hugo-theme-meme.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVinícius Hashimoto <me@vkhashimoto.dev>2022-07-22 04:13:12 +0300
committerGitHub <noreply@github.com>2022-07-22 04:13:12 +0300
commitbabefc97831b0104270173b07883558638466fe4 (patch)
tree8ecb79dfdfca9e9b16a003524cfec4c68e21695a
parent60de71479c38fda111003f7baf9c2cac8ca73836 (diff)
fix: remove country code on lunr language validation (#394)
-rw-r--r--layouts/partials/third-party/lunr-search.html5
1 files changed, 3 insertions, 2 deletions
diff --git a/layouts/partials/third-party/lunr-search.html b/layouts/partials/third-party/lunr-search.html
index b9b318e..9b96351 100644
--- a/layouts/partials/third-party/lunr-search.html
+++ b/layouts/partials/third-party/lunr-search.html
@@ -5,9 +5,10 @@
{{- $scripts := slice $src -}}
{{- if ne .Site.Language.Lang "en" -}}
+ {{- $lang := substr .Site.Language.Lang 0 2 -}}
{{- $supported := slice "ar" "da" "de" "du" "es" "fi" "fr" "hu" "it" "ja" "nl" "no" "pt" "ro" "ru" "sv" "tr" "vi" -}}
- {{- if in $supported .Site.Language.Lang -}}
- {{- if eq .Site.Language.Lang "ja" -}}
+ {{- if in $supported $lang -}}
+ {{- if eq $lang "ja" -}}
{{- $scripts = union $scripts (slice $srcTinyseg) -}}
{{- end -}}
{{- $scripts = union $scripts (slice $srcStemmer) -}}