summaryrefslogtreecommitdiffstats
path: root/layouts/shortcodes/gallery.html
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-04-22 12:42:56 +0200
committerDanilo M. <danix@danix.xyz>2026-04-22 12:42:56 +0200
commit631547a75142326a7c71bdf123e1475217a5ad73 (patch)
treef3cfef6b3c5b42bf626fc823ddcf63b8dcf4cdbb /layouts/shortcodes/gallery.html
parent77ccbe72fad5a4870185fff374f75471c16a9043 (diff)
downloaddanixxyz-theme-631547a75142326a7c71bdf123e1475217a5ad73.tar.gz
danixxyz-theme-631547a75142326a7c71bdf123e1475217a5ad73.zip
chore: replace with extracted danix.xyz-hacker theme (danix2-hugo-theme)
Diffstat (limited to 'layouts/shortcodes/gallery.html')
-rw-r--r--layouts/shortcodes/gallery.html13
1 files changed, 11 insertions, 2 deletions
diff --git a/layouts/shortcodes/gallery.html b/layouts/shortcodes/gallery.html
index f9e546e..b66c327 100644
--- a/layouts/shortcodes/gallery.html
+++ b/layouts/shortcodes/gallery.html
@@ -1,3 +1,12 @@
-<div class="photo-grid" data-lightbox="true">
- {{ .Inner }}
+{{- $cols := .Get "cols" | default "2" -}}
+
+<div class="my-8 grid gap-4" style="grid-template-columns: repeat({{ $cols }}, 1fr)">
+ {{- range $line := strings.Split .Inner "\n" -}}
+ {{- if strings.Contains $line "![" -}}
+ {{- $image := strings.TrimSpace $line -}}
+ {{- if $image -}}
+ {{ $image | markdownify | safeHTML }}
+ {{- end -}}
+ {{- end -}}
+ {{- end -}}
</div>