aboutsummaryrefslogtreecommitdiff
path: root/generators/hugo/themes/tdro/layouts/shortcodes/image.rss.xml
diff options
context:
space:
mode:
authorThedro Neely <thedroneely@gmail.com>2021-06-19 01:35:07 -0400
committerThedro Neely <thedroneely@gmail.com>2021-06-19 01:35:07 -0400
commit1ea82e754a8567f397915933ecaa24d1f32ab19a (patch)
treed5d50f2092716258be51c99651356e762526d5af /generators/hugo/themes/tdro/layouts/shortcodes/image.rss.xml
parent46ebc59aa8b4f7800f702ebbdfd12845f5534517 (diff)
downloadthedroneely.com-1ea82e754a8567f397915933ecaa24d1f32ab19a.tar.gz
thedroneely.com-1ea82e754a8567f397915933ecaa24d1f32ab19a.tar.bz2
thedroneely.com-1ea82e754a8567f397915933ecaa24d1f32ab19a.zip
generators/hugo/layouts/_default/rss: Fix and normalize RSS feeds
Use layout mechanism to hide some short codes on RSS output format.
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>