summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSam Anthony <sam@samanthony.xyz>2026-01-21 13:32:40 -0500
committerSam Anthony <sam@samanthony.xyz>2026-01-21 13:32:40 -0500
commit7e971e862a43361ec77c3b2c7a4345dd9e771784 (patch)
tree15569e8bf3e047ca64ad23ec21951da0a88c68d8
parent97d154d31a018290c35a8c42ae5ed7cad7bb6381 (diff)
downloadsamanthony.xyz-7e971e862a43361ec77c3b2c7a4345dd9e771784.zip
add tables of assets to article/page template
-rw-r--r--content/articles/automotive-spreadsheets.md3
-rw-r--r--layouts/_partials/assets.html12
-rw-r--r--layouts/articles/automotive-spreadsheets.html6
-rw-r--r--layouts/articles/page.html1
4 files changed, 15 insertions, 7 deletions
diff --git a/content/articles/automotive-spreadsheets.md b/content/articles/automotive-spreadsheets.md
index f14cd0f..b3a7587 100644
--- a/content/articles/automotive-spreadsheets.md
+++ b/content/articles/automotive-spreadsheets.md
@@ -3,7 +3,8 @@ title = 'Automotive Spreadsheets'
date = '2026-01-10T17:22:57-05:00'
tags = ["Cars"]
draft = false
-layout = "automotive-spreadsheets"
+[assets]
+ 'Spreadsheets' = 'auto/*.ods'
+++
Collection of spreadsheets for calculating suspension dynamics, brake bias, and so on.
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 := . -}}
+ <h1>{{ strings.FirstUpper $title }}</h1>
+ {{ 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 }}