aboutsummaryrefslogtreecommitdiff
path: root/generators/hugo/themes/tdro/layouts/shortcodes/image.rss.xml
diff options
context:
space:
mode:
Diffstat (limited to 'generators/hugo/themes/tdro/layouts/shortcodes/image.rss.xml')
-rw-r--r--generators/hugo/themes/tdro/layouts/shortcodes/image.rss.xml14
1 files changed, 14 insertions, 0 deletions
diff --git a/generators/hugo/themes/tdro/layouts/shortcodes/image.rss.xml b/generators/hugo/themes/tdro/layouts/shortcodes/image.rss.xml
new file mode 100644
index 0000000..69a4202
--- /dev/null
+++ b/generators/hugo/themes/tdro/layouts/shortcodes/image.rss.xml
@@ -0,0 +1,14 @@
+{{ $imageFile := print "public" (.Get `source`) }}
+{{ $image := imageConfig $imageFile }}
+
+{{ $ratio := 0 }}
+{{ if lt (mul (div (float $image.Height) $image.Width) 100) 100 }}
+{{ $ratio = mul (div (float $image.Height) $image.Width) 100 }}
+{{ end }}
+
+<figure>
+ <a href="{{ .Get `source` }}">
+ <img data-image-zoom src="{{ .Get `source` }}" alt="{{ .Get `title` }}" title="{{ .Get `title` }}" width="{{ $image.Width }}" height="{{ $image.Height }}"/>
+ </a>
+ <figcaption class="has-text-centered has-text-grey-dark">{{ .Inner }}</figcaption>
+</figure>