summaryrefslogtreecommitdiff
path: root/templates/search.html
blob: 9a6dbf7e5819f67612d50ec99d5606741562d803 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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}}