hugo-theme-noteworthy/layouts/shortcodes/resize-image.html

12 lines
356 B
HTML
Raw Normal View History

{{ $src := .Page.Resources.GetMatch (printf "*%s*" (.Get "src")) }}
{{ if .Get "caption"}}
<figure class="article-figure">
{{ end }}
<img class="article-image" src="{{ $src.RelPermalink }}" {{ with .Get "alt" }}alt="{{.}}"{{ else }}alt=""{{ end }}>
{{ if .Get "caption"}}
<figcaption>{{ .Get "caption" }}</figcaption>
</figure>
{{ end }}