summaryrefslogtreecommitdiffstats
path: root/themes/danix-xyz-hacker/layouts/shortcodes/gallery.html
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-04-15 16:38:12 +0200
committerDanilo M. <danix@danix.xyz>2026-04-15 16:38:12 +0200
commit231d29bf26820ca058dec57c06345943ca6dbbf2 (patch)
treeb60f6e4afd1bf88bcfeb02b6d28f00cc1806ccc9 /themes/danix-xyz-hacker/layouts/shortcodes/gallery.html
parent46065a5077f113ab772e3a46f83748efe5f81caf (diff)
downloaddanixxyz-231d29bf26820ca058dec57c06345943ca6dbbf2.tar.gz
danixxyz-231d29bf26820ca058dec57c06345943ca6dbbf2.zip
Fix shortcode location: move from shortcodes/ to layouts/shortcodes/
Hugo v0.156.0+ requires shortcodes to be in layouts/shortcodes/ directory. Moved all shortcodes (gravatar, image, gallery, contact-form) to correct location. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Diffstat (limited to 'themes/danix-xyz-hacker/layouts/shortcodes/gallery.html')
-rw-r--r--themes/danix-xyz-hacker/layouts/shortcodes/gallery.html12
1 files changed, 12 insertions, 0 deletions
diff --git a/themes/danix-xyz-hacker/layouts/shortcodes/gallery.html b/themes/danix-xyz-hacker/layouts/shortcodes/gallery.html
new file mode 100644
index 0000000..b66c327
--- /dev/null
+++ b/themes/danix-xyz-hacker/layouts/shortcodes/gallery.html
@@ -0,0 +1,12 @@
+{{- $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>