diff options
author | VinÃcius Hashimoto <me@vkhashimoto.dev> | 2022-07-22 04:13:12 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-22 04:13:12 +0300 |
commit | babefc97831b0104270173b07883558638466fe4 (patch) | |
tree | 8ecb79dfdfca9e9b16a003524cfec4c68e21695a | |
parent | 60de71479c38fda111003f7baf9c2cac8ca73836 (diff) |
fix: remove country code on lunr language validation (#394)
-rw-r--r-- | layouts/partials/third-party/lunr-search.html | 5 |
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) -}} |