You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
1.3 KiB
30 lines
1.3 KiB
<figure{{ with .Get "class" }} class="{{ . }}" {{ end }}{{ with .Get "id" }} id="{{ . }}" {{ end }}>
|
|
{{- if .Get "link" -}}
|
|
<a href="{{ .Get "link" }}" {{ with .Get "target" }} target="{{ . }}" {{ end }}{{ with .Get "rel" }} rel="{{ . }}"
|
|
{{ end }}>
|
|
{{- end -}}
|
|
{{- if eq (.Get "raw") true }}
|
|
{{- $img := resources.Get (.Get "src") }}
|
|
<img src="{{ $img.Permalink }}" {{- if or (.Get "alt") (.Get "caption") }}
|
|
alt="{{ with .Get "alt" }}{{ . }}{{ else }}{{ .Get "caption" | markdownify| plainify }}{{ end }}" {{- end -}}
|
|
width="{{ .Get "width" | default $img.Width }}" height="{{ .Get "height" | default $img.Height }}" />
|
|
{{- else }}
|
|
{{- partial "image.html" (dict "path" (.Get "src") "alt" (or (.Get "alt") (.Get "caption" | markdownify | plainify)) "width" (.Get "width") "height" (.Get "height")) }}
|
|
{{- end }}
|
|
{{- if .Get "link" }}</a>{{ end -}}
|
|
{{- if or (or (.Get "title") (.Get "caption")) (.Get "attr") -}}
|
|
<figcaption>
|
|
{{ 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> |