Implemented search functionality
This commit is contained in:
parent
ee235ae70b
commit
3bba78a22c
8 changed files with 251 additions and 1 deletions
15
search/search.html
Normal file
15
search/search.html
Normal file
|
@ -0,0 +1,15 @@
|
|||
{{ define "search" }}
|
||||
<form action="/search/" method="post">
|
||||
<input class="fullwidth" type="text" placeholder="Enter your search terms here" name="query" value="{{ .Query }}" required><br>
|
||||
<input type="checkbox" id="searchTitle" name="searchTitle" value="true"{{ if .SearchTitle }} checked{{ end }}><label for="searchTitle">Titles</label>
|
||||
<input type="checkbox" id="searchTags" name="searchTags" value="true"{{ if .SearchTags }} checked{{ end }}><label for="searchTags">Tags</label>
|
||||
<input type="checkbox" id="searchDescription" name="searchDescription" value="true"{{ if .SearchDescription }} checked{{ end }}><label for="searchDescription">Descriptions</label>
|
||||
<input type="checkbox" id="searchContent" name="searchContent" value="true"{{ if .SearchContent }} checked{{ end }}><label for="searchContent">Contents</label>
|
||||
<input type="submit" value="Search">
|
||||
</form>
|
||||
<ul>
|
||||
{{ range .Results }}
|
||||
<li><a href="{{ .Permalink }}">{{ .Title }}</a> : {{ .Description }}</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
{{ end }}
|
Loading…
Add table
Add a link
Reference in a new issue