Matthieu Bessat
f9e49913bf
All checks were successful
Deploy workflow / deploy (push) Successful in 13s
31 lines
1.3 KiB
HTML
31 lines
1.3 KiB
HTML
<figure class="figure fig-img {{ with .Get "class" }}{{ . }}{{ end }}">
|
|
{{- if .Get "link" -}}
|
|
<a href="{{ .Get "link" }}"{{ with .Get "target" }} target="{{ . }}"{{ end }}{{ with .Get "rel" }} rel="{{ . }}"{{ end }}>
|
|
{{- end -}}
|
|
|
|
{{ $options := .Get "options" }}
|
|
{{ $img := (.Page.Resources.GetMatch (.Get "src")).Fit $options }}
|
|
<img src="{{ $img.RelPermalink }}"
|
|
{{- if or (.Get "alt") (.Get "caption") }}
|
|
alt="{{ with .Get "alt" }}{{ . }}{{ else }}{{ .Get "caption" | markdownify| plainify }}{{ end }}"
|
|
{{- end -}}
|
|
class="figure-img img-fluid rounded"
|
|
/><!-- Closing img tag -->
|
|
{{- if .Get "link" }}</a>{{ end -}}
|
|
{{- if or (or (.Get "title") (.Get "caption")) (.Get "attr") -}}
|
|
<figcaption class="figure-caption">
|
|
{{ with (.Get "title") -}}
|
|
<h4>{{ . }}</h4>
|
|
{{- end -}}
|
|
{{- if or (.Get "caption") (.Get "attr") -}}<p>
|
|
{{- .Get "caption" | markdownify -}}
|
|
{{- with .Get "attrlink" }}
|
|
<a href="{{ . }}">
|
|
{{- end -}}
|
|
{{- .Get "attr" | markdownify -}}
|
|
{{- if .Get "attrlink" }}</a>{{ end }}</p>
|
|
{{- end }}
|
|
</figcaption>
|
|
{{- end }}
|
|
</figure>
|
|
|