Skip to content

Commit

Permalink
fix(third-party): add tinyseg.js to scripts if japanese (#305)
Browse files Browse the repository at this point in the history
  • Loading branch information
nu50218 committed Feb 10, 2021
1 parent d392ab1 commit ed7f353
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions layouts/partials/third-party/lunr-search.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
{{- if ne .Site.Language.Lang "en" -}}
{{- $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" -}}
{{- $scripts = union $scripts (slice "https://cdn.jsdelivr.net/npm/lunr-languages@1.4.0/tinyseg.js") -}}
{{- end -}}
{{- $scripts = union $scripts (slice "https://cdn.jsdelivr.net/npm/lunr-languages@1.4.0/min/lunr.stemmer.support.min.js") -}}
{{- $scripts = union $scripts (slice (printf "https://cdn.jsdelivr.net/npm/lunr-languages@1.4.0/min/lunr.%s.min.js" .Site.Language.Lang)) -}}
{{- else -}}
Expand Down

0 comments on commit ed7f353

Please sign in to comment.