mirror of
https://github.com/dillonzq/LoveIt.git
synced 2024-11-14 19:06:16 +01:00
28 lines
1.3 KiB
HTML
28 lines
1.3 KiB
HTML
{{- $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 -}}
|
|
<figcaption class="image-caption">
|
|
{{- . | safeHTML -}}
|
|
</figcaption>
|
|
</figure>
|
|
{{- else -}}
|
|
{{- partial "plugin/image.html" $options -}}
|
|
{{- end -}}
|