From 2db7ec622fc9d666590dd33a3d48818be9772c2d Mon Sep 17 00:00:00 2001 From: InLaw Date: Sun, 21 May 2023 21:28:45 +0200 Subject: [PATCH] tpl/tplimpl: Add img loading attribute to figure shortcode (#10927) --- docs/content/en/content-management/shortcodes.md | 3 +++ tpl/tplimpl/embedded/templates/shortcodes/figure.html | 1 + 2 files changed, 4 insertions(+) diff --git a/docs/content/en/content-management/shortcodes.md b/docs/content/en/content-management/shortcodes.md index 634444684..a9269c216 100644 --- a/docs/content/en/content-management/shortcodes.md +++ b/docs/content/en/content-management/shortcodes.md @@ -117,6 +117,9 @@ height width : `width` attribute of the image. +loading +: `loading` attribute of the image. + attr : Image attribution text. Markdown within the value of `attr` will be rendered. diff --git a/tpl/tplimpl/embedded/templates/shortcodes/figure.html b/tpl/tplimpl/embedded/templates/shortcodes/figure.html index ecabb286e..afe784c19 100644 --- a/tpl/tplimpl/embedded/templates/shortcodes/figure.html +++ b/tpl/tplimpl/embedded/templates/shortcodes/figure.html @@ -8,6 +8,7 @@ {{- end -}} {{- with .Get "width" }} width="{{ . }}"{{ end -}} {{- with .Get "height" }} height="{{ . }}"{{ end -}} + {{- with .Get "loading" }} loading="{{ . }}"{{ end -}} /> {{- if .Get "link" }}{{ end -}} {{- if or (or (.Get "title") (.Get "caption")) (.Get "attr") -}}