2022-01-12 03:21:22 +00:00
{{ $altText := .Get "alt" }}
{{ $caption := .Get "caption" }}
{{ $href := .Get "href" }}
{{ $class := .Get "class" }}
{{ with $.Page.Resources.GetMatch (.Get "src") }}
< figure { { with $ class } } class = "{{ . }}" { { end } } >
{{ with $href }}< a href = "{{ . }}" > {{ end }}
< img
2022-01-30 22:14:30 +00:00
class="my-0 rounded-md"
2022-01-12 03:21:22 +00:00
srcset="
2022-01-30 22:14:30 +00:00
{{ (.Resize "330x").RelPermalink }} 330w,
{{ (.Resize "660x").RelPermalink }} 660w,
2022-01-12 03:21:22 +00:00
{{ (.Resize "1024x").RelPermalink }} 1024w,
2022-01-30 22:14:30 +00:00
{{ (.Resize "1320x").RelPermalink }} 2x"
src="{{ (.Resize "660x").RelPermalink }}"
2022-01-12 03:21:22 +00:00
alt="{{ $altText }}"
/>
{{ if $href }}< / a > {{ end }}
{{ with $caption }}< figcaption > {{ . | markdownify }}< / figcaption > {{ end }}
2021-08-11 05:28:33 +00:00
< / figure >
2022-01-12 03:21:22 +00:00
{{ else }}
{{ errorf `[CONGO] Shortcode "figure" error in "%s": Resource "%s" not found. Check the path is correct or remove the shortcode.` .Page.Path (.Get "src") }}
2021-08-11 05:28:33 +00:00
{{ end }}