summaryrefslogtreecommitdiffstats
path: root/layouts/shortcodes/gallery.html
diff options
context:
space:
mode:
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>