{{ if $link }}{{ end }}
{{- $assetBusting := partialCached "assetbusting.hugo" . }}
{{- $pageBaseLang := replaceRE "([a-z]+).*" "${1}" .Page.Language.LanguageCode }}
{{- $contentlangs := (union (slice | append (.Site.Params.additionalContentLanguage | default slice)) (slice $pageBaseLang)) }}
{{- $quotedcontentlangs := slice }}
{{- $missingcontentlangs := slice }}
{{- range $contentlangs }}
{{- $f := printf "/static/js/lunr/lunr.%s.min.js" . }}
{{- if partialCached "fileExists.hugo" $f $f }}
{{- $quotedcontentlangs = $quotedcontentlangs | append (printf "'%s'" .) }}
{{- else }}
{{- $missingcontentlangs = $missingcontentlangs | append . }}
{{- end }}
{{- end }}
{{- $contentlangs = $contentlangs | complement $missingcontentlangs }}
{{- $tinyseg := false }}
{{- $wordcut := false }}
{{- range $contentlangs }}
{{- if and (not $tinyseg) (or (eq . "ja")) }}
{{- $tinyseg = true }}
{{- end }}
{{- if and (not $wordcut) (or (eq . "hi") (eq . "th")) }}
{{- $wordcut = true }}
{{- end }}
{{- $file := (printf "js/lunr/lunr.%s.min.js" .) }}
{{- end }}