diff options
author | nu50218 <40682920+nu50218@users.noreply.github.com> | 2021-02-10 06:38:20 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-10 06:38:20 +0300 |
commit | ed7f353f772edc281857b6ac34d0fb0489db1bd4 (patch) | |
tree | 739b030699055bb1096857434adbbda0ebf4bd80 | |
parent | d392ab181418d8ed7224132f5e45b64564351bd3 (diff) |
fix(third-party): add tinyseg.js to scripts if japanese (#305)
-rw-r--r-- | layouts/partials/third-party/lunr-search.html | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/layouts/partials/third-party/lunr-search.html b/layouts/partials/third-party/lunr-search.html index 4713ec4..90e9aaa 100644 --- a/layouts/partials/third-party/lunr-search.html +++ b/layouts/partials/third-party/lunr-search.html @@ -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 -}} |