aboutsummaryrefslogtreecommitdiff
path: root/templates/wiki.html
blob: 36305c6e715bc304d0cbc7cba521798e4aab2fc9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
{{define "title"}}Wiki {{.Data.Page}} - {{.Data.Path}} - {{.Site}}{{end}}
{{define "main"}}
<h2>Wiki{{with .Data.Page}} <span class="dim">{{.}}</span>{{end}}</h2>

{{with .Data.Pages}}
<p>
Pages:
{{range .}}<a href="/{{$.Data.Path}}/wiki/{{.}}">{{if .}}{{.}}{{else}}index{{end}}</a>&#32;
{{end}}
</p>
{{end}}

{{if .Data.Can}}
<form method="get" action="/{{.Data.Path}}/wiki/">
<p>
<label for="page">New page, or an existing one to edit</label>
<input id="page" name="page" placeholder="setup, or runbooks/dns" autocapitalize="none" required>
<button type="submit">Write it</button>
</p>
</form>
{{end}}

{{if .Data.Empty}}
<p>This wiki has no pages yet.</p>
{{if .Data.Can}}<p><a href="/{{.Data.Path}}/wiki?edit">Write the first one</a>.</p>{{end}}
{{else if .Data.Missing}}
<p>There is no page here yet.</p>
{{if .Data.Can}}<p><a href="/{{.Data.Path}}/wiki/{{.Data.Page}}?edit">Write it</a>.</p>{{end}}
{{else}}
<article>{{.Data.Rendered}}</article>
<p>
{{if .Data.Can}}<a href="/{{.Data.Path}}/wiki/{{.Data.Page}}?edit">Edit</a>{{end}}
<a href="/{{.Data.Path}}.wiki/log/{{.Data.File}}">History</a>
</p>
{{end}}

{{end}}