Welcome to mirror list, hosted at ThFree Co, Russian Federation.

render-image.html « _markup « _default « layouts - github.com/uPagge/uBlogger.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: e6ffb9df3232ae3be99e6a90e3d52bea17484926 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
{{ $figcap := or .Title }}
{{ $caption := or .Text " " }}
{{ $alt := or .Text $figcap }}
{{- if eq $figcap $caption -}}
{{ $caption = " " }}
{{- end -}}

{{- if $figcap -}}
<figure>
    {{- dict "Src" .Destination "Title" $figcap "Alt" $alt "Caption" $caption "Linked" true "Resources" .Page.Resources | partial "plugin/image.html" -}}
    <figcaption class="image-caption">
        {{- $figcap | safeHTML -}}
    </figcaption>
</figure>
{{- else -}}
{{- dict "Src" .Destination "Title" (path.Base .Destination) "Alt" $alt "Resources" .Page.Resources | partial "plugin/image.html" -}}
{{- end -}}