mirror of https://github.com/onweru/compose.git

weru
31.34.2025 58b2d2b2cb07aecd69e2a538e6a3b550cd726b51
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
{{- $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 }}