Welcome to mirror list, hosted at ThFree Co, Russian Federation.

search-form.html « partials « layouts - gitlab.com/rmaguiar/hugo-theme-color-your-world.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: e109286a88c7a4ee911eb26a5f9b69b80b877a58 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<!--
  Assume that the first page in a collection with pages
  using the "search" layout is the main search page
-->
{{ $searchPage := index (where .Site.RegularPages "Layout" "eq" "search") 0 }}

{{ $minLength := .Site.Params.Search.minLength | default .Site.Data.default.search.minLength }}
{{ $maxLength := .Site.Params.Search.maxLength | default .Site.Data.default.search.maxLength }}

<section class="req-js search-box">
  {{ if eq .Layout "search" }}
    <form role="search">
  {{ else }}
    <form role="search" action="{{ $searchPage.RelPermalink }}">
  {{ end }}
      <label class="label-form" for="search-input">{{ T "search_label" }}</label><input class="input-text" type="search" id="search-input" title='{{ T "search_input_title" (dict "minLength" $minLength "maxLength" $maxLength) }}' name="q" {{ with .Site.Params.Search.placeholder }}placeholder="{{ . }}"{{ end }} minlength="{{ $minLength }}" maxlength="{{ $maxLength }}" pattern="^[\S].*" required><button aria-label="{{ T "search_button_aria_label" }}" class="btn outline-dashed" type="submit"><svg aria-hidden="true"><use xlink:href="#search"/></svg></button>
    </form>
  <hr>
</section>