]> git.maquefel.me Git - brevno-suite/hugo/commitdiff
tpl: Add loading attribute to qr shortcode
authorNicolas Friedli <nicolas@theologique.ch>
Fri, 17 Jan 2025 18:06:54 +0000 (19:06 +0100)
committerGitHub <noreply@github.com>
Fri, 17 Jan 2025 18:06:54 +0000 (19:06 +0100)
tpl/tplimpl/embedded/templates/shortcodes/qr.html

index 252ebeae7a75b887ebda0865ebfff28456f28361..818f6656df2dd38bcecd44cd0fcc1d6d5dd58de1 100644 (file)
@@ -9,6 +9,7 @@ Encodes the given text into a QR code using the specified options and renders th
 @param {string} [class] The class attribute of the img element.
 @param {string} [id] The id attribute of the img element.
 @param {string} [title] The title attribute of the img element.
+@param {string} [loading] The loading attribute of the img element, one of lazy, or eager. 
 
 @returns {template.HTML}
 
@@ -46,6 +47,8 @@ Encodes the given text into a QR code using the specified options and renders th
 {{- $class := or (.Get "class") "" }}
 {{- $id := or (.Get "id") "" }}
 {{- $title := or (.Get "title") "" }}
+{{- $loading := or (.Get "loading") "" }}
+
 
 {{- /* Validate arguments. */}}
 {{- $errors := false}}
@@ -71,6 +74,7 @@ Encodes the given text into a QR code using the specified options and renders th
       {{- with $class }} class="{{ $class }}" {{- end }}
       {{- with $id }} id="{{ $id }}" {{- end }}
       {{- with $title }} title="{{ $title }}" {{- end -}}
+      {{- with $loading }} loading="{{ $loading }}" {{- end -}}
     >
   {{- end }}
 {{- end -}}