hugo-theme-hello-friend/layouts/shortcodes/figure.html

9 lines
536 B
HTML
Raw Permalink Normal View History

2018-12-13 08:35:47 +01:00
{{ if .Get "src" }}
<figure class="{{ with .Get "position"}}{{ . }}{{ else -}} left {{- end }}" >
<img src="{{ .Get "src" | safeURL }}" {{ with .Get "alt" }} alt="{{ . | plainify }}" {{ end }} {{ with .Get "style" }} style="{{ . | safeCSS }}" {{ end }} />
{{ if .Get "caption" }}
2019-07-11 14:21:22 +02:00
<figcaption class="{{ with .Get "captionPosition"}}{{ . }}{{ else -}} center {{- end }}" {{ with .Get "captionStyle" }} style="{{ . | safeCSS }}" {{ end }}>{{ .Get "caption" | markdownify }}</figcaption>
2018-12-13 08:35:47 +01:00
{{ end }}
</figure>
{{ end }}