{{- $link := "" }} {{- with .Site.Home.OutputFormats.Get "json" }} {{- warnf "UNSUPPORTED usage of 'json' output format found, use 'search' instead; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration#600" }} {{- end }} {{- if .Site.Home.OutputFormats.Get "search" }} {{- with .Site.Home.OutputFormats.Get "searchpage" }} {{- $link = partial "relLangPrettyUglyURL.hugo" (dict "to" .) }} {{- end }} {{- end }} {{ if $link }}
{{ end }} {{ if $link }}
{{ end }}
{{- $assetBusting := not .Site.Params.disableAssetsBusting }} {{- $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 }}