gunk-dev/the-valley

layout.tmpl

sourceaf38e23853bamain's published tip history
1.8 KiB
1{{define "layout"}}<!doctype html>
2<html lang="en">
3<head>
4<meta charset="utf-8">
5<meta name="viewport" content="width=device-width, initial-scale=1">
6<title>{{.Title}}</title>
7<style>{{.Style}}</style>
8</head>
9<body>
10<div class="page">
11{{- if .Nav}}
12<nav class="site" aria-label="Pages">
13 {{- range .Nav}}<a href="{{.URL}}">{{.Text}}</a>{{end}}
14 {{- with .Fresh}}<span class="fresh">Collected {{.Collected}}. Policy last checked {{.Checked}}, {{.Age}}{{if .Stale}} <span class="chip stale">stale</span>{{end}}</span>{{end}}
15</nav>
16{{- end}}
17{{template "content" .Content}}
18</div>
19{{- with .Script}}
20<script>{{.}}</script>
21{{- end}}
22</body>
23</html>
24{{end}}
25
26{{define "glyph"}}<i class="k {{glyph .}}" role="img" aria-label="{{label .}}" title="{{label .}}"></i>{{end}}
27
28{{define "project-head"}}
29<header class="project-head">
30 <span class="mono">{{.Name}}</span>
31 <nav class="tabs" aria-label="Project">{{range .Tabs}}<a href="{{.URL}}"{{if .Current}} aria-current="page"{{end}}>{{.Text}}</a>{{end}}</nav>
32</header>
33{{end}}
34
35{{define "source-head"}}
36<header class="knot-head">
37 <div class="meta">
38 <span class="eyebrow">source</span><span class="mono">{{.Short}}</span>
39 {{- if .AtTip}}<span class="chip">main's published tip</span>{{else}}<a href="{{.TipURL}}">main's published tip</a>{{end}}
40 <a href="{{.LogURL}}">history</a>
41 {{- block "source-download" .}}{{end}}
42 </div>
43 <nav class="crumbs" aria-label="Path">
44 {{- range $i, $c := .Crumbs}}{{if $i}}<span class="muted">/</span>{{end}}{{if .URL}}<a href="{{.URL}}">{{.Text}}</a>{{else}}<span>{{.Text}}</span>{{end}}{{end -}}
45 </nav>
46</header>
47{{end}}
48
49{{define "document"}}
50{{- with .Contents}}<details class="contents"><summary>Contents</summary><ul>{{range .}}<li class="level{{.Level}}"><a href="{{.URL}}">{{.Text}}</a></li>{{end}}</ul></details>{{end}}
51<div class="markdown">{{.HTML}}</div>
52{{- end}}