From: Danilo M. Date: Wed, 15 Apr 2026 13:52:14 +0000 (+0200) Subject: feat: create image shortcode with lazy-loading and captions X-Git-Tag: release_22042026-1342~262 X-Git-Url: https://git.danix.xyz/?a=commitdiff_plain;h=0848ab287f117f740977c1309365f6700e63aabc;p=danix.xyz-2.git feat: create image shortcode with lazy-loading and captions --- diff --git a/themes/danix-xyz-hacker/shortcodes/image.html b/themes/danix-xyz-hacker/shortcodes/image.html new file mode 100644 index 0000000..07a698d --- /dev/null +++ b/themes/danix-xyz-hacker/shortcodes/image.html @@ -0,0 +1,22 @@ +{{- $src := .Get "src" -}} +{{- $alt := .Get "alt" | default "Image" -}} +{{- $caption := .Get "caption" -}} +{{- $class := .Get "class" | default "rounded-lg border border-border/30" -}} + +{{- if $src -}} +
+ {{ $alt }} + {{- if $caption -}} +
+ {{ $caption }} +
+ {{- end -}} +
+{{- else -}} + {{- errorf "image shortcode: 'src' parameter is required" -}} +{{- end -}}