frostfs.info/layouts/shortcodes/glossary.html
Mikhail Petrov 5807c420af [#1] Implement initial doc site
Signed-off-by: Mikhail Petrov <m.petrov@yadro.com>
2022-12-29 15:35:27 +03:00

54 lines
1.6 KiB
HTML

<style>
.primary .article-container article {
overflow-x: visible;
}
</style>
{{ $styles := resources.Get "sass/glossary.scss" | resources.ToCSS | resources.Minify | resources.Fingerprint }}
<link rel="stylesheet" href="{{ $styles.Permalink }}" integrity="{{ $styles.Data.Integrity }}" media="screen">
<div class="glossary">
{{- $glossary := .Site.GetPage "/concepts/glossary" -}}
{{- $words := $glossary.Resources.ByType "page" -}}
<div class="trampolines">
{{- $previous := "-" -}}
{{ range $w := $words }}
{{ $first := upper (slicestr $w.Title 0 1) }}
{{ if ne $first $previous }}
{{ if ne $previous "-" }}
|
{{ end }}
<a href="#{{ $first }}" aria-label="Words starting with the letter {{ $first }}">{{ $first }}</a>
{{ $previous = $first }}
{{ end }}
{{ end }}
</div>
<div class="entries">
{{ $previous = "-" }}
{{ range $w := $words }}
{{ $first := upper (slicestr $w.Title 0 1) }}
{{ if ne $first $previous }}
{{ if ne $previous "-" }}
</dl>
</div>
{{ end }}
<div id="{{ $first }}" class="letter">
<h4>{{ $first }}</h4>
<dl>
{{ $previous = $first }}
{{ end }}
{{ $name := $w.Title | urlize }}
<dt id="{{ $name }}">{{ $w.Title }}</dt>
<dd aria-labelledby="{{ $name }}">{{ $w.Content }}</dd>
{{ end }}
</dl>
</div>
</div>
</div>