snowchive-server/templates/glossary.html
2026-11-19 04:40:59 +02:00

36 lines
1.5 KiB
HTML

{{ define "title" }}Glossary - Snowden Archive{{ end }}
{{ define "content" }}
<h1>Glossary {{ if .Total }}<small class="muted">({{ .Total }} terms)</small>{{ end }}</h1>
{{ if .Groups }}
<nav class="letter-nav" aria-label="Jump to letter">
{{ range .Groups }}<a href="#g{{ .Letter }}">{{ .Letter }}</a>{{ end }}
</nav>
{{ if .GroupsHTML }}{{ .GroupsHTML }}{{ else }}{{ template "glossary-groups" . }}{{ end }}{{ else }}
<p class="muted">No glossary entries.</p>
{{ end }}
{{ end }}
{{ template "base.html" . }}
{{ define "glossary-groups" }}{{ range .Groups }}
<section class="glossary-group" id="g{{ .Letter }}">
<h2>{{ .Letter }}</h2>
<dl class="glossary-list">
{{ range .Entries }}
<dt id="term-{{ pathEscape .Term }}">
{{ .Term }}
{{ if .Aka }}<span class="muted glossary-aka">(a.k.a. {{ range $i, $a := .Aka }}{{ if $i }}, {{ end }}{{ $a }}{{ end }})</span>{{ end }}
<a class="glossary-search" href="{{ .SearchURL }}"{{ if .Aka }} title="Searches the term and its aliases"{{ end }}>search &rarr;</a>
</dt>
<dd>
{{ .DefinitionHTML }}
{{ if .SeeLinks }}<div class="glossary-see muted">See also:
{{ range $i, $s := .SeeLinks }}{{ if $i }}, {{ end }}{{ if $s.Term }}<a href="#term-{{ pathEscape $s.Term }}">{{ $s.Name }}</a>{{ else }}{{ $s.Name }}{{ end }}{{ end }}
</div>{{ end }}
</dd>
{{ end }}
</dl>
</section>
{{ end }}
{{ end }}