fix(widget/search): remove hardcoded form action
This commit is contained in:
parent
ae477ab224
commit
5ac2552e7c
@ -1,10 +1,16 @@
|
|||||||
<form action="/search" class="search-form widget" {{ with .OutputFormats.Get "json" -}}data-json="{{ .Permalink }}" {{- end }}>
|
{{- $query := first 1 (where .Site.Pages "Layout" "==" "search") -}}
|
||||||
<p>
|
{{- if $query -}}
|
||||||
<label>{{ T "search.title" }}</label>
|
{{- $searchPage := index $query 0 -}}
|
||||||
<input name="keyword" required placeholder="{{ T `search.placeholder` }}" />
|
<form action="{{ $searchPage.RelPermalink }}" class="search-form widget" {{ with .OutputFormats.Get "json" -}}data-json="{{ .Permalink }}" {{- end }}>
|
||||||
|
<p>
|
||||||
<button title="Search">
|
<label>{{ T "search.title" }}</label>
|
||||||
{{ partial "helper/icon" "search" }}
|
<input name="keyword" required placeholder="{{ T `search.placeholder` }}" />
|
||||||
</button>
|
|
||||||
</p>
|
<button title="{{ T `search.title` }}">
|
||||||
</form>
|
{{ partial "helper/icon" "search" }}
|
||||||
|
</button>
|
||||||
|
</p>
|
||||||
|
</form>
|
||||||
|
{{- else -}}
|
||||||
|
{{- warnf "Search page not found. Create a page with layout: search." -}}
|
||||||
|
{{- end -}}
|
Loading…
Reference in New Issue
Block a user