2020-03-19 05:35:37 +01:00
|
|
|
{{- $options := cond .IsNamedParams (.Get "src") (.Get 0) | dict "src" -}}
|
|
|
|
{{- $options = cond .IsNamedParams (.Get "alt") (.Get 1) | .Page.RenderString | dict "alt" | merge $options -}}
|
|
|
|
{{- $caption := cond .IsNamedParams (.Get "caption") (.Get 2) | .Page.RenderString -}}
|
|
|
|
{{- $options = dict "caption" $caption | merge $options -}}
|
|
|
|
|
|
|
|
{{- if .IsNamedParams -}}
|
|
|
|
{{- $options = dict "title" (.Get "title") | merge $options -}}
|
|
|
|
{{- $options = dict "src_s" (.Get "src_s") | merge $options -}}
|
|
|
|
{{- $options = dict "src_l" (.Get "src_l") | merge $options -}}
|
|
|
|
{{- $options = dict "height" (.Get "height") | merge $options -}}
|
|
|
|
{{- $options = dict "width" (.Get "width") | merge $options -}}
|
|
|
|
{{- $options = dict "large" (.Get "large") | merge $options -}}
|
|
|
|
{{- $options = .Get "linked" | ne false | dict "linked" | merge $options -}}
|
|
|
|
{{- $options = dict "rel" (.Get "rel") | merge $options -}}
|
|
|
|
{{- else -}}
|
|
|
|
{{- $options = cond $caption true false | dict "linked" | merge $options -}}
|
|
|
|
{{- end -}}
|
|
|
|
|
|
|
|
{{- with $caption -}}
|
|
|
|
<figure{{ with cond $.IsNamedParams ($.Get "class") "" }} class="{{ . }}"{{ end }}>
|
|
|
|
{{- partial "plugin/image.html" $options -}}
|
2020-03-02 09:47:28 +01:00
|
|
|
<figcaption class="image-caption">
|
|
|
|
{{- . | safeHTML -}}
|
|
|
|
</figcaption>
|
2020-03-19 05:35:37 +01:00
|
|
|
</figure>
|
|
|
|
{{- else -}}
|
|
|
|
{{- partial "plugin/image.html" $options -}}
|
|
|
|
{{- end -}}
|