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

20 lines
No EOL
822 B
HTML

{{- $searchEnabled := partialCached "functions/getSearchConfig" . }}
{{- if $searchEnabled }}
{{- $section := .Section }}
{{- $config := site.Params }}
{{- $default := T "search_field_placeholder" (dict "section" "") }}
{{- $scope := T "site" }}
{{- if and $section (eq $config.search.global false) }}
{{- $scope = $section }}
{{- end }}
<div class="search">
<label for="find" class="search_label">
{{- partial "sprite" (dict "icon" "search") }}
</label>
{{ $placeholder := printf "%s %s" $default $scope }}
<input type="search" class="search_field standardize-input" placeholder="{{ $placeholder }}" id="find" autocomplete="off" data-scope='{{ $section }}'>
{{- if ne .Params.searchPage true }}
<div class="search_results results"></div>
{{- end }}
</div>
{{- end }}