From 7e971e862a43361ec77c3b2c7a4345dd9e771784 Mon Sep 17 00:00:00 2001 From: Sam Anthony Date: Wed, 21 Jan 2026 13:32:40 -0500 Subject: add tables of assets to article/page template --- layouts/_partials/assets.html | 12 ++++++++++++ layouts/articles/automotive-spreadsheets.html | 6 ------ layouts/articles/page.html | 1 + 3 files changed, 13 insertions(+), 6 deletions(-) create mode 100644 layouts/_partials/assets.html delete mode 100644 layouts/articles/automotive-spreadsheets.html (limited to 'layouts') diff --git a/layouts/_partials/assets.html b/layouts/_partials/assets.html new file mode 100644 index 0000000..6930496 --- /dev/null +++ b/layouts/_partials/assets.html @@ -0,0 +1,12 @@ +{{- /* +Render a list of tables of assets. + +@context {.} dict Mapping from section titles to asset glob patterns. + +@examle: {{ partial "assets.html" (dict "Spreadsheets" "auto/*.ods") }} +*/}} + +{{- range $title, $pattern := . -}} +

{{ strings.FirstUpper $title }}

+ {{ partial "asset-table.html" (resources.Match $pattern) }} +{{- end -}} diff --git a/layouts/articles/automotive-spreadsheets.html b/layouts/articles/automotive-spreadsheets.html deleted file mode 100644 index b2e27ab..0000000 --- a/layouts/articles/automotive-spreadsheets.html +++ /dev/null @@ -1,6 +0,0 @@ -{{ define "main" }} - {{ partial "articles/header.html" . }} - {{ .Content }} - {{ partial "asset-table.html" (resources.Match "auto/*.ods") }} - {{ partial "terms.html" (dict "taxonomy" "tags" "page" .) }} -{{ end }} diff --git a/layouts/articles/page.html b/layouts/articles/page.html index e15623e..f56c8ea 100644 --- a/layouts/articles/page.html +++ b/layouts/articles/page.html @@ -1,5 +1,6 @@ {{ define "main" }} {{ partial "articles/header.html" . }} {{ .Content }} + {{ partial "assets" .Params.Assets }} {{ partial "terms.html" (dict "taxonomy" "tags" "page" .) }} {{ end }} -- cgit v1.2.3