From 365a47dedf958836fed8fe35db8610d872736955 Mon Sep 17 00:00:00 2001 From: Joe Mooring Date: Wed, 8 Jan 2025 10:10:18 -0800 Subject: [PATCH] tpl/images: Change signature of images.QR to images.QR TEXT OPTIONS Closes #13230 --- content/en/functions/images/QR.md | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/content/en/functions/images/QR.md b/content/en/functions/images/QR.md index c1b8fb465..9d58e7163 100644 --- a/content/en/functions/images/QR.md +++ b/content/en/functions/images/QR.md @@ -6,7 +6,7 @@ action: aliases: [] related: [] returnType: images.ImageResource - signatures: ['images.QR OPTIONS'] + signatures: ['images.QR TEXT OPTIONS'] toc: true math: true --- @@ -25,9 +25,6 @@ Although the default option values are sufficient for most applications, you sho ## Options -text -: (`string`) The text to encode. - level : (`string`) The error correction level to use when encoding the text, one of `low`, `medium`, `quartile`, or `high`. Default is `medium`. @@ -51,8 +48,8 @@ targetDir To create a QR code using the default values for `level` and `scale`: ```go-html-template -{{ $opts := dict "text" "https://gohugo.io" }} -{{ with images.QR $opts }} +{{ $text := "https://gohugo.io" }} +{{ with images.QR $text }} {{ end }} ``` @@ -62,13 +59,13 @@ To create a QR code using the default values for `level` and `scale`: Specify `level`, `scale`, and `targetDir` as needed to achieve the desired result: ```go-html-template +{{ $text := "https://gohugo.io" }} {{ $opts := dict - "text" "https://gohugo.io" "level" "high" "scale" 3 "targetDir" "codes" }} -{{ with images.QR $opts }} +{{ with images.QR $text $opts }} {{ end }} ```