diff options
| author | Sam Anthony <sam@samanthony.xyz> | 2026-01-10 18:42:34 -0500 |
|---|---|---|
| committer | Sam Anthony <sam@samanthony.xyz> | 2026-01-10 18:42:34 -0500 |
| commit | 03d596db3dc1e90fcd63ac5f203326773de75e28 (patch) | |
| tree | b7e17e2b44e0dcd5cf129308dc3ca716f7887177 /layouts/_partials/asset_table.html | |
| parent | 84aa7993ef24ed68763db11d141146f82a2f23fd (diff) | |
| download | samanthony.xyz-03d596db3dc1e90fcd63ac5f203326773de75e28.zip | |
automotive spreadsheets
Diffstat (limited to 'layouts/_partials/asset_table.html')
| -rw-r--r-- | layouts/_partials/asset_table.html | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/layouts/_partials/asset_table.html b/layouts/_partials/asset_table.html new file mode 100644 index 0000000..116b22d --- /dev/null +++ b/layouts/_partials/asset_table.html @@ -0,0 +1,32 @@ +{{- /* +For a given collection of global resources, render a table with +the modification date of each resource and a link to the resource. +The resources must be from the assets/ directory in order to get their +modification times. + +@context {,} resource.Resources + +@example: {{ partial "asset_table.html" (resources.Match "spreadsheets/*.ods") }} +*/}} + +<table> + <thead> + <tr> + <th>Mod. date</th> + <th>File</th> + </tr> + </thead> + <tbody> + {{ range . }} + {{- $fpath := printf "assets/%s" .Name -}} + <tr> + <td> + {{- with os.Stat $fpath -}} + {{- .ModTime | time.Format "2006-01-02" -}} + {{- end -}} + </td> + <td><a href="{{ .RelPermalink }}">{{ path.Base .Name }}</a></td> + </tr> + {{- end }} + </tbody> +</table> |