diff options
| author | Lena <lena@omega> | 2026-08-01 00:00:00 +0000 |
|---|---|---|
| committer | Lena <lena@omega> | 2026-08-01 00:00:00 +0000 |
| commit | bb6bc2387d58c737dbf92e73f8544bf39319dbd8 (patch) | |
| tree | 6d5eaf5dac213074cd832da50f64260fce728fed /templates/wiki.html | |
| download | git-forge-master.tar.gz | |
A small self-hosted git forge: HTTP push and pull, cgit browsing,
local and OIDC accounts, TOTP, scoped push tokens, per-repo
permissions, issues, a wiki, and outbound mail.
It does not reimplement git. git-http-backend and cgit run as CGI
behind its own listener, which authorises every request before
exec'ing either. One binary, one data directory, one listener: no
database, no JavaScript, and state is JSON in a git repo with a
working tree.
Diffstat (limited to 'templates/wiki.html')
| -rw-r--r-- | templates/wiki.html | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/templates/wiki.html b/templates/wiki.html new file mode 100644 index 0000000..36305c6 --- /dev/null +++ b/templates/wiki.html @@ -0,0 +1,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>  +{{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}} |