From e8202cebf0880c57f7e10439482a48c5c7a895f2 Mon Sep 17 00:00:00 2001 From: Marcell Mars Date: Sat, 24 Jul 2021 23:07:42 +0200 Subject: [PATCH] initial taxonomy list(s).. --- layouts/taxonomy/baseof.html | 12 ++++++++++++ layouts/taxonomy/list.html | 16 ++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 layouts/taxonomy/baseof.html create mode 100644 layouts/taxonomy/list.html diff --git a/layouts/taxonomy/baseof.html b/layouts/taxonomy/baseof.html new file mode 100644 index 0000000..ff6a2c7 --- /dev/null +++ b/layouts/taxonomy/baseof.html @@ -0,0 +1,12 @@ + + + + {{- partialCached "head.html" . -}} + {{- .Title }} - {{ .Site.Title -}} + {{- partialCached "sandpointjs.html" . .RelPermalink -}} + + + {{- block "keywords" . -}}{{- end -}} + {{- partialCached "footer.html" . -}} + + diff --git a/layouts/taxonomy/list.html b/layouts/taxonomy/list.html new file mode 100644 index 0000000..e4ddf2e --- /dev/null +++ b/layouts/taxonomy/list.html @@ -0,0 +1,16 @@ +{{ define "keywords" }} + {{ $p := split (trim .RelPermalink "/") "/" }} + {{ if eq (len $p) 1 }} +
{{ index $p 0 }}⁄All
+ {{ range $taxonomyname, $taxonomy := .Site.Taxonomies }} + {{ range $key, $value := $taxonomy }} + {{ $key }}({{ len (index $.Site.Taxonomies.keywords $key) }}) + {{ end }} + {{ end }} + {{ else }} +
{{ index $p 0 }}⁄{{ index $p 1 }}
+ {{ range .Pages }} +
  • {{ .Title }}
  • + {{ end }} + {{ end }} +{{ end }}