search.html 706 B

12345678910111213141516
  1. {{- $query := first 1 (where .Context.Site.Pages "Layout" "==" "search") -}}
  2. {{- if $query -}}
  3. {{- $searchPage := index $query 0 -}}
  4. <form action="{{ $searchPage.RelPermalink }}" class="search-form widget" {{ with .OutputFormats.Get "json" -}}data-json="{{ .Permalink }}" {{- end }}>
  5. <p>
  6. <label>{{ T "search.title" }}</label>
  7. <input name="keyword" required placeholder="{{ T `search.placeholder` }}" />
  8. <button title="{{ T `search.title` }}">
  9. {{ partial "helper/icon" "search" }}
  10. </button>
  11. </p>
  12. </form>
  13. {{- else -}}
  14. {{- warnf "Search page not found. Create a page with layout: search." -}}
  15. {{- end -}}