mirror of https://github.com/jpanther/congo.git
26 lines
698 B
HTML
26 lines
698 B
HTML
{{ if .Get "src" }}
|
|
{{ $image := .Page.Resources.GetMatch (printf "*%s*" (.Get "src")) }}
|
|
<!-- prettier-ignore -->
|
|
<figure{{ with .Get "class" }} class="{{ . }}"{{ end }}>
|
|
{{- if .Get "href" -}}
|
|
<a href="{{ .Get "href" }}">
|
|
{{- end -}}
|
|
|
|
{{ $altText := "" }}
|
|
{{ with .Get "alt" }}
|
|
{{ $altText = . }}
|
|
{{ else }}
|
|
{{ $altText = (.Get "caption") | markdownify | plainify }}
|
|
{{ end }}
|
|
|
|
{{ partial "picture.html" (dict "img" $image "alt" $altText "x2" true) }}
|
|
|
|
{{- if .Get "href" }}</a>{{ end -}}
|
|
{{- if .Get "caption" -}}
|
|
<figcaption>
|
|
{{- .Get "caption" | markdownify -}}
|
|
</figcaption>
|
|
{{- end }}
|
|
</figure>
|
|
{{ end }}
|