{{ define "body-class" }}template-search{{ end }} {{ define "head" }} {{- with .OutputFormats.Get "json" -}} {{- end -}} {{ end }} {{ define "main" }}
{{- $searchfunc := "" -}} {{- $opts := dict "minify" hugo.IsProduction "JSXFactory" "createElement" -}} {{- if eq .Site.Params.widgets.search.mode "original" -}} {{- $searchfunc = "ts/search.tsx" -}} {{- else if eq .Site.Params.widgets.search.mode "nohighlight" -}} {{- $searchfunc = "ts/search_nohl.tsx" -}} {{- else if eq .Site.Params.widgets.search.mode "wholeword" -}} {{- $searchfunc = "ts/search_ww.tsx" -}} {{- else if eq .Site.Params.widgets.search.mode "highlight" -}} {{- $searchfunc = "ts/search_hl.tsx" -}} {{- else -}} {{ warnf "Searching function not defined" }} {{- end -}} {{- $searchScript := resources.Get $searchfunc | js.Build $opts -}} {{ partialCached "footer/footer" . }} {{ end }}