From 0874b03e9443458a770d88fd20dcb83b834ae977 Mon Sep 17 00:00:00 2001 From: Joe Mooring Date: Wed, 12 Feb 2025 09:43:02 -0800 Subject: [PATCH] content: Publish QR code examples to the images/qr directory --- content/en/functions/images/QR.md | 9 +++------ content/en/shortcodes/qr.md | 6 +++--- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/content/en/functions/images/QR.md b/content/en/functions/images/QR.md index 70a0cd5e2..e3f914fd1 100644 --- a/content/en/functions/images/QR.md +++ b/content/en/functions/images/QR.md @@ -54,7 +54,7 @@ To create a QR code using the default values for `level` and `scale`: {{ end }} ``` -{{< qr text="https://gohugo.io" class="qrcode" />}} +{{< qr text="https://gohugo.io" class="qrcode" targetDir="images/qr" />}} Specify `level`, `scale`, and `targetDir` as needed to achieve the desired result: @@ -63,14 +63,14 @@ Specify `level`, `scale`, and `targetDir` as needed to achieve the desired resul {{ $opts := dict "level" "high" "scale" 3 - "targetDir" "codes" + "targetDir" "images/qr" }} {{ with images.QR $text $opts }} {{ end }} ``` -{{< qr text="https://gohugo.io" level="high" scale=3 targetDir="codes" class="qrcode" />}} +{{< qr text="https://gohugo.io" level="high" scale=3 targetDir="codes" class="qrcode" targetDir="images/qr" />}} To include a QR code that points to the `Permalink` of the current page: @@ -103,9 +103,6 @@ Then hide the QR code with CSS unless printing the page: } ``` - - - ## Scale As you decrease the size of a QR code, the maximum distance at which it can be reliably scanned by a device also decreases. diff --git a/content/en/shortcodes/qr.md b/content/en/shortcodes/qr.md index 6208c6998..a7a6d92cb 100755 --- a/content/en/shortcodes/qr.md +++ b/content/en/shortcodes/qr.md @@ -44,7 +44,7 @@ https://gohugo.io Both of the above produce this image: -{{< qr text="https://gohugo.io" class="qrcode" />}} +{{< qr text="https://gohugo.io" class="qrcode" targetDir="images/qr" />}} To create a QR code for a phone number: @@ -52,7 +52,7 @@ To create a QR code for a phone number: {{}} ``` -{{< qr text="tel:+12065550101" class="qrcode" />}} +{{< qr text="tel:+12065550101" class="qrcode" targetDir="images/qr" />}} To create a QR code containing contact information in the [vCard] format: @@ -72,7 +72,7 @@ END:VCARD {{}} ``` -{{< qr level="low" scale=2 alt="QR code of vCard for John Smith" class="qrcode" >}} +{{< qr level="low" scale=2 alt="QR code of vCard for John Smith" class="qrcode" targetDir="images/qr" >}} BEGIN:VCARD VERSION:2.1 N;CHARSET=UTF-8:Smith;John;R.;Dr.;PhD