From edd9fff9f52f15c0c85cde4a50d1a4831871d28c Mon Sep 17 00:00:00 2001 From: James Jiang Date: Sat, 15 Aug 2026 16:22:39 +1000 Subject: [PATCH] feat(postlist): allow tileImages front matter to pick hover-rotation frames Lets a post specify which 4 images (and their order) cycle on postlist tile hover, instead of always using the bundle's first 4 resources. --- exampleSite/content/posts/gruyaert/index.md | 1 + layouts/postlist/single.html | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/exampleSite/content/posts/gruyaert/index.md b/exampleSite/content/posts/gruyaert/index.md index bd91de10..edebac1f 100644 --- a/exampleSite/content/posts/gruyaert/index.md +++ b/exampleSite/content/posts/gruyaert/index.md @@ -6,6 +6,7 @@ title: 'On Harry Gruyaert' date: 2026-05-18 url: /posts/gruyaert/ lede: 'Colour as weather — the Belgian who photographed light itself and let the subject arrive later.' +tileImages: ['22.jpg', '8.jpg', '30.jpg', '14.jpg'] --- Gruyaert came to colour when colour was still suspect, and made a case for it that no diff --git a/layouts/postlist/single.html b/layouts/postlist/single.html index e79adc57..4b5cbbb5 100644 --- a/layouts/postlist/single.html +++ b/layouts/postlist/single.html @@ -7,6 +7,17 @@ {{- $posts := where site.RegularPages "Type" "post" -}} {{- range $post := $posts.ByDate.Reverse -}} {{- $frames := $post.Resources.ByType "image" -}} + {{- with $post.Params.tileImages -}} + {{- $picked := slice -}} + {{- range $name := . -}} + {{- with $post.Resources.GetMatch $name -}} + {{- $picked = $picked | append . -}} + {{- end -}} + {{- end -}} + {{- if $picked -}} + {{- $frames = $picked -}} + {{- end -}} + {{- end -}} {{- if $frames -}}