aboutsummaryrefslogtreecommitdiff
path: root/generators/hugo/themes/tdro/layouts/shortcodes/image.rss.xml
blob: 41244e00c27ab5f54e3595cfa51089808fa883db (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
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 | markdownify }}</figcaption>
</figure>