From 8f0a341644fb0d9575b5429ca6193609a4d12d02 Mon Sep 17 00:00:00 2001 From: Sam Anthony Date: Wed, 21 Jan 2026 17:34:37 -0500 Subject: tags --- content/articles/automotive-spreadsheets.md | 2 +- content/articles/foo.md | 6 ++++++ layouts/_partials/articles/header.html | 8 -------- layouts/_partials/asset-table.html | 2 +- layouts/_partials/assets.html | 2 +- layouts/_partials/pages.html | 26 ++++++++++++++++++++++++++ layouts/_partials/taxonomy-url.html | 11 +++++++++++ layouts/_partials/terms.html | 18 ++++++++++++++++++ layouts/articles/page.html | 14 ++++++++++++-- layouts/list.html | 17 +---------------- layouts/taxonomy.html | 19 +++++++++++++++++++ layouts/term.html | 6 ++++++ themes/aoidh/assets/aoidh.css | 2 +- themes/aoidh/layouts/_partials/terms.html | 23 ----------------------- 14 files changed, 103 insertions(+), 53 deletions(-) create mode 100644 content/articles/foo.md delete mode 100644 layouts/_partials/articles/header.html create mode 100644 layouts/_partials/pages.html create mode 100644 layouts/_partials/taxonomy-url.html create mode 100644 layouts/_partials/terms.html create mode 100644 layouts/taxonomy.html create mode 100644 layouts/term.html delete mode 100644 themes/aoidh/layouts/_partials/terms.html diff --git a/content/articles/automotive-spreadsheets.md b/content/articles/automotive-spreadsheets.md index b3a7587..b4760cc 100644 --- a/content/articles/automotive-spreadsheets.md +++ b/content/articles/automotive-spreadsheets.md @@ -1,7 +1,7 @@ +++ title = 'Automotive Spreadsheets' date = '2026-01-10T17:22:57-05:00' -tags = ["Cars"] +tags = ["cars"] draft = false [assets] 'Spreadsheets' = 'auto/*.ods' diff --git a/content/articles/foo.md b/content/articles/foo.md new file mode 100644 index 0000000..6300edf --- /dev/null +++ b/content/articles/foo.md @@ -0,0 +1,6 @@ ++++ +title = 'Foo' +date = '2026-01-21T15:16:20-05:00' +tags = ["cars", "foo", "bar"] +draft = true ++++ diff --git a/layouts/_partials/articles/header.html b/layouts/_partials/articles/header.html deleted file mode 100644 index e415b89..0000000 --- a/layouts/_partials/articles/header.html +++ /dev/null @@ -1,8 +0,0 @@ -

{{ .Title }}

-

- {{- partial "date.html" .Date -}} - {{- if gt .Lastmod .Date -}} - — modified {{ partial "date.html" .Lastmod }} - {{- end -}} -

-
diff --git a/layouts/_partials/asset-table.html b/layouts/_partials/asset-table.html index d5e893c..df47501 100644 --- a/layouts/_partials/asset-table.html +++ b/layouts/_partials/asset-table.html @@ -6,7 +6,7 @@ have a corresponding .moddate file, e.g., assets/foo/bar.txt and assets/foo/bar.txt.moddate containing "1999-01-02". This is to preserve the modification times of files when the repository is cloned. -@context {.} resource.Resources +@context {resource.Resources} . @example: {{ partial "asset-table.html" (resources.Match "spreadsheets/*.ods") }} */}} diff --git a/layouts/_partials/assets.html b/layouts/_partials/assets.html index 6930496..8bb5d2a 100644 --- a/layouts/_partials/assets.html +++ b/layouts/_partials/assets.html @@ -1,7 +1,7 @@ {{- /* Render a list of tables of assets. -@context {.} dict Mapping from section titles to asset glob patterns. +@context {dict} . Mapping from section titles to asset glob patterns. @examle: {{ partial "assets.html" (dict "Spreadsheets" "auto/*.ods") }} */}} diff --git a/layouts/_partials/pages.html b/layouts/_partials/pages.html new file mode 100644 index 0000000..6a7dc16 --- /dev/null +++ b/layouts/_partials/pages.html @@ -0,0 +1,26 @@ +{{- /* +Renders a table of pages. + +@context {Page} . Current page. + +@example: {{ partial "page-list.html" .Pages }} +*/}} + + + + + + + + + + + {{- range .Pages }} + + + + + + {{- end }} + +
DateTitleTags
{{ partial "date.html" .Date -}}{{ .LinkTitle }}{{ partial "terms.html" (dict "taxonomy" "tags" "page" .) }}
diff --git a/layouts/_partials/taxonomy-url.html b/layouts/_partials/taxonomy-url.html new file mode 100644 index 0000000..259cc9b --- /dev/null +++ b/layouts/_partials/taxonomy-url.html @@ -0,0 +1,11 @@ +{{- /* +Renders the URL of a taxonomy page. + +@context {string} taxonomy Name of the taxonomy. +@context {site} site The site. + +@example: tags +*/}} + +{{- $taxonomy := index .site.Taxonomies .taxonomy -}} +{{- $taxonomy.Page.RelPermalink -}} diff --git a/layouts/_partials/terms.html b/layouts/_partials/terms.html new file mode 100644 index 0000000..afe3a14 --- /dev/null +++ b/layouts/_partials/terms.html @@ -0,0 +1,18 @@ +{{- /* +For a given taxonomy, renders a comma-separated list of terms assigned to the page. + +@context {string} taxonomy The taxonomy. +@context {page} page The current page. + +@example: {{ partial "terms.html" (dict "taxonomy" "tags" "page" .) }} +*/}} + +{{- $taxonomy := .taxonomy }} +{{- $page := .page }} + +{{- with $page.GetTerms $taxonomy -}} + {{- range $index, $term := . -}} + {{- if $index }}, {{ end -}} + {{ .LinkTitle }} + {{- end -}} +{{- end -}} diff --git a/layouts/articles/page.html b/layouts/articles/page.html index f56c8ea..357cc9f 100644 --- a/layouts/articles/page.html +++ b/layouts/articles/page.html @@ -1,6 +1,16 @@ {{ define "main" }} - {{ partial "articles/header.html" . }} +

{{ .Title }}

+

+ {{- partial "date.html" .Date -}} + {{- if gt .Lastmod .Date -}} + — modified {{ partial "date.html" .Lastmod }} + {{- end -}} +
+ {{- if .Page.GetTerms "tags" }} + Tags: {{ partial "terms.html" (dict "taxonomy" "tags" "page" .) -}}. + {{- end }} +

+
{{ .Content }} {{ partial "assets" .Params.Assets }} - {{ partial "terms.html" (dict "taxonomy" "tags" "page" .) }} {{ end }} diff --git a/layouts/list.html b/layouts/list.html index 8c2a19f..43c0bc4 100644 --- a/layouts/list.html +++ b/layouts/list.html @@ -1,19 +1,4 @@ {{ define "main" }}

{{ .Title }}

- - - - - - - - - {{ range .Pages }} - - - - - {{ end }} - -
DateTitle
{{ partial "date.html" .Date -}}{{ .LinkTitle }}
+ {{ partial "pages.html" . }} {{ end }} diff --git a/layouts/taxonomy.html b/layouts/taxonomy.html new file mode 100644 index 0000000..ef791e8 --- /dev/null +++ b/layouts/taxonomy.html @@ -0,0 +1,19 @@ +{{ define "main" }} + {{- $taxonomy := .Data -}} +

{{ .Title }}

+ {{ .Content }} + + + + + + + {{- range $taxonomy.Terms.ByCount }} + + + + + {{- end }} + +
{{ $taxonomy.Singular | humanize }}Pages
{{ .Page.Title }}{{ .Count }}
+{{ end }} diff --git a/layouts/term.html b/layouts/term.html new file mode 100644 index 0000000..2a99edb --- /dev/null +++ b/layouts/term.html @@ -0,0 +1,6 @@ +{{ define "main" }} + {{- $term := .Data -}} +

Pages with {{ $term.Singular | humanize }} ‘{{ .Title }}’

+ {{ .Content }} + {{- partial "pages.html" . -}} +{{ end }} diff --git a/themes/aoidh/assets/aoidh.css b/themes/aoidh/assets/aoidh.css index 0d52fc3..caf22b4 100644 --- a/themes/aoidh/assets/aoidh.css +++ b/themes/aoidh/assets/aoidh.css @@ -154,7 +154,7 @@ th, td { vertical-align: middle; } -th { +th, th * { font-weight: 500; } diff --git a/themes/aoidh/layouts/_partials/terms.html b/themes/aoidh/layouts/_partials/terms.html deleted file mode 100644 index 8a6ebec..0000000 --- a/themes/aoidh/layouts/_partials/terms.html +++ /dev/null @@ -1,23 +0,0 @@ -{{- /* -For a given taxonomy, renders a list of terms assigned to the page. - -@context {page} page The current page. -@context {string} taxonomy The taxonomy. - -@example: {{ partial "terms.html" (dict "taxonomy" "tags" "page" .) }} -*/}} - -{{- $page := .page }} -{{- $taxonomy := .taxonomy }} - -{{- with $page.GetTerms $taxonomy }} - {{- $label := (index . 0).Parent.LinkTitle }} -
-
{{ $label }}:
- -
-{{- end }} -- cgit v1.2.3