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: 07f34c2da01222b2c8e517a30c8edc34117efa66 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
{{ $figcap := or .Title }}
{{ $caption := or .Text " " }}
{{ $alt := or .Text $figcap }}
{{- if eq $figcap $caption -}}
{{ $caption = " " }}
{{- end -}}

{{ $imageOriginal := .Page.Resources.GetMatch (printf "%s" (.Destination | safeURL)) }}
<div style="text-align: center">
{{- 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 -}}
</div>