Skip to content

Commit

Permalink
fix: remove country code on lunr language validation (#394)
Browse files Browse the repository at this point in the history
  • Loading branch information
vkhashimoto committed Jul 22, 2022
1 parent 60de714 commit babefc9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions layouts/partials/third-party/lunr-search.html
Original file line number Diff line number Diff line change
Expand Up @@ -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) -}}
Expand Down

0 comments on commit babefc9

Please sign in to comment.