-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Expand file tree
/
Copy pathsearch.html
More file actions
16 lines (15 loc) · 760 Bytes
/
Copy pathsearch.html
File metadata and controls
16 lines (15 loc) · 760 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{{- $query := first 1 (where .Context.Site.Pages "Layout" "==" "search") -}}
{{- if $query -}}
{{- $searchPage := index $query 0 -}}
<form action="{{ $searchPage.RelPermalink }}" class="search-form widget" {{ with .OutputFormats.Get "json" -}}data-json="{{ .RelPermalink }}" {{- end }}>
<p>
<label for="search-widget-input">{{ T "search.title" }}</label>
<input id="search-widget-input" name="keyword" required placeholder="{{ T `search.placeholder` }}" />
<button title="{{ T `search.title` }}">
{{ partial "helper/icon" "search" }}
</button>
</p>
</form>
{{- else -}}
{{- warnf "Search page not found. Create a page with layout: search." -}}
{{- end -}}