compose-theme/layouts/partials/scripts/search.html
2024-07-26 17:08:59 +02:00

14 lines
No EOL
658 B
HTML

{{- $searchEnabled := partialCached "functions/getSearchConfig" . }}
{{ if $searchEnabled }}
{{- $fuse := partial "functions/getScript" (dict "slug" "search/fuse") }}
{{- $variables := partial "functions/getScript" (dict "slug" "search/variables") }}
{{- $algolia := partial "functions/getScript" (dict "slug" "search/algolia") }}
{{- $search := partial "functions/getScript" (dict "slug" "search/index") }}
{{- $searchLib := $fuse }}
{{- if site.Params.search.algolia.enable }}
{{- $searchLib = $algolia }}
{{- end }}
{{- partial "scripts/getJsBundle" (dict "scripts" (slice $searchLib $variables $search) "slug" "search") }}
{{ end }}