aboutsummaryrefslogtreecommitdiff
path: root/search/search.html
diff options
context:
space:
mode:
authorJulien Dessaux2021-09-12 14:03:45 +0200
committerJulien Dessaux2021-09-12 14:03:45 +0200
commit3bba78a22c4a3c31a936bbcec954420ce1776776 (patch)
treea11c0e22d3c76e9ea5650f307b38a87b9d1bfa55 /search/search.html
parentRemove subtitles from the index.json since I do not use those (diff)
downloadwww-3bba78a22c4a3c31a936bbcec954420ce1776776.tar.gz
www-3bba78a22c4a3c31a936bbcec954420ce1776776.tar.bz2
www-3bba78a22c4a3c31a936bbcec954420ce1776776.zip
Implemented search functionality
Diffstat (limited to 'search/search.html')
-rw-r--r--search/search.html15
1 files changed, 15 insertions, 0 deletions
diff --git a/search/search.html b/search/search.html
new file mode 100644
index 0000000..74041ab
--- /dev/null
+++ b/search/search.html
@@ -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 }}