Sandpoints-Obsidian/layouts/taxonomy/list.html

23 lines
1.1 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{{/*
ANY EDIT
(07.11.23) - Removed Author and Date from Keyword taxonomy list (/keywords/). Pages provided by reverse date
(01.11.24) - Pages in Keyword list sorted in alphabetic order (not .ByDate.Reverse, but .ByTitle)
*/}}
{{ define "keywords" }}
{{ $p := split (trim .RelPermalink "/") "/" }}
{{ if eq (len $p) 1 }}
<div class="coretitle"><span class="supt">{{ index $p 0 }}</span>All</div>
{{ range $taxonomyname, $taxonomy := .Site.Taxonomies }}
{{ if eq (index $p 0) $taxonomyname }}
{{ range $key, $value := $taxonomy }}
<span> <a href="/{{ index $p 0 }}/{{ $key }}/{{ if eq hugo.Environment "offline" }}index.html{{ end }}">{{ $key }}</a>({{ len (index (index $.Site.Taxonomies $taxonomyname) $key) }})</span>
{{ end }}
{{ end }}
{{ end }}
{{ else }}
<div class="coretitle"><span class="supt">{{ index $p 0 }}</span>{{ index $p 1 }}</div>
{{ range .Pages.ByTitle }}
<div class="blog-title"><a href="{{ .RelPermalink }}{{ if eq hugo.Environment "offline" }}index.html{{ end }}">{{ .Title }}</a></div>
{{ end }}
{{ end }}
{{ end }}