diff options
author | Dillon <dillonzq@outlook.com> | 2020-02-03 13:38:10 +0300 |
---|---|---|
committer | Dillon <dillonzq@outlook.com> | 2020-02-03 13:38:10 +0300 |
commit | 52c7ad29a60cc4ee6c51217d11bb4877ef0cf88a (patch) | |
tree | 4bf578ddcdbf78b8543bf33d948feceac2b7f5e8 /layouts/_default/_markup | |
parent | 8aba2262906628f38f114a9947783bc6c7fd7495 (diff) |
chore(style): update code style and add an i18n word
Diffstat (limited to 'layouts/_default/_markup')
-rw-r--r-- | layouts/_default/_markup/render-image.html | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/layouts/_default/_markup/render-image.html b/layouts/_default/_markup/render-image.html index c143d1d..402f4fe 100644 --- a/layouts/_default/_markup/render-image.html +++ b/layouts/_default/_markup/render-image.html @@ -1,11 +1,11 @@ <figure> + {{- /* Lazyload */ -}} {{- $loading := resources.Get "svg/loading.svg" | minify -}} <img src="{{ $loading.RelPermalink }}" data-sizes="auto" data-src="{{ .Destination | safeURL }}" alt="{{ .Text }}"{{ with .Title }} title="{{ . }}"{{ end }} class="lazyload"> - <figcaption class="image-caption"> - {{- if .Title -}} - {{- .Title -}} - {{- else -}} - {{- .Text -}} - {{- end -}} - </figcaption> + {{- $caption := .Title | default .Text -}} + {{- with $caption -}} + <figcaption class="image-caption"> + {{- . -}} + </figcaption> + {{- end -}} </figure>
\ No newline at end of file |