Skip to content

Commit

Permalink
tpl/tplimpl: Add img loading attribute to figure shortcode (#10927)
Browse files Browse the repository at this point in the history
  • Loading branch information
InLaw committed May 21, 2023
1 parent e6dc805 commit 2db7ec6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docs/content/en/content-management/shortcodes.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
1 change: 1 addition & 0 deletions tpl/tplimpl/embedded/templates/shortcodes/figure.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
{{- end -}}
{{- with .Get "width" }} width="{{ . }}"{{ end -}}
{{- with .Get "height" }} height="{{ . }}"{{ end -}}
{{- with .Get "loading" }} loading="{{ . }}"{{ end -}}
/><!-- Closing img tag -->
{{- if .Get "link" }}</a>{{ end -}}
{{- if or (or (.Get "title") (.Get "caption")) (.Get "attr") -}}
Expand Down

0 comments on commit 2db7ec6

Please sign in to comment.