diff options
author | Laria Carolin Chabowski <laria@laria.me> | 2021-01-01 14:46:54 +0100 |
---|---|---|
committer | Laria Carolin Chabowski <laria@laria.me> | 2021-01-01 14:46:54 +0100 |
commit | 85473656174b1b1d6221d3bb76cc12fa5f7f7e8d (patch) | |
tree | 37349eee4f64781f06e8597dc4c457801eb03a47 /templates/search.html | |
download | laria.me-85473656174b1b1d6221d3bb76cc12fa5f7f7e8d.tar.gz laria.me-85473656174b1b1d6221d3bb76cc12fa5f7f7e8d.tar.bz2 laria.me-85473656174b1b1d6221d3bb76cc12fa5f7f7e8d.zip |
Initial commit
Diffstat (limited to 'templates/search.html')
-rw-r--r-- | templates/search.html | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/templates/search.html b/templates/search.html new file mode 100644 index 0000000..9a6dbf7 --- /dev/null +++ b/templates/search.html @@ -0,0 +1,21 @@ +{{define "main"}} +<form action="/blog/search" method="get"> + <label>Search terms: <input type="text" name="q" value="{{.Q}}"></label> + <button type="submit">Go</button> + <!-- TODO: Form looks ugly, especially in dark mode --> +</form> + +{{if .Q}} +{{if gt .Total 0}} + <h1>Results ({{.Total}} total)</h1> + {{template "article_list" .Results}} + + {{if gt .Pages 1}} + <p>{{pagination .Pages .Page "/blog/search" "q" .Q}}</p> + {{end}} +{{else}} + <p>Nothing found</p> +{{end}} +{{end}} + +{{end}} |