From ff9c90f68ba28ca41b1c5443ab15ca9c269dd334 Mon Sep 17 00:00:00 2001 From: Ben Goldsworthy Date: Mon, 5 May 2025 21:27:09 +0200 Subject: [PATCH] feat: video galleries --- assets/css/components/_gallery.scss | 14 +++++++++ layouts/shortcodes/gallery.html | 49 ++++++++++++++++++----------- 2 files changed, 44 insertions(+), 19 deletions(-) diff --git a/assets/css/components/_gallery.scss b/assets/css/components/_gallery.scss index 41867c4..fed3b63 100644 --- a/assets/css/components/_gallery.scss +++ b/assets/css/components/_gallery.scss @@ -9,4 +9,18 @@ grid-column-end: -1; grid-column-start: 1; } + + & .figure { + margin-trim: unset; + + @supports not (margin-trim: block) { + &:first-child { + margin-block-start: 16px; + } + + &:last-child { + margin-block-end: unset; + } + } + } } diff --git a/layouts/shortcodes/gallery.html b/layouts/shortcodes/gallery.html index 60673b4..8f7f9f8 100644 --- a/layouts/shortcodes/gallery.html +++ b/layouts/shortcodes/gallery.html @@ -10,32 +10,43 @@ {{- with (.Get "dir") -}} - {{- $images := $.Page.Resources.Match ( print . "/*" ) }} - {{- range $images -}} + {{- $resources := $.Page.Resources.Match ( print . "/*" ) }} + {{- range $resources -}} {{- $caption := .Name | replaceRE "\\..*" "" | humanize }} {{- $linkURL := print $.Page.Permalink ($.Get "dir") "/" .Name | absURL }}