theme: Generate QR code once per page

This commit is contained in:
Joe Mooring 2025-06-02 09:42:39 -07:00 committed by GitHub
parent 784891b877
commit fc7cd28787
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,8 +1,8 @@
{{ if or .IsSection .IsPage }}
<div class="hidden print:flex justify-between border-b-1 border-b-gray-400 mb-4">
<p class="flex flex-col justify-end text-4xl mb-3">Hugo Documentation</p>
{{ with images.QR .Permalink (dict "scale" 3) }}
<img class="mb-2 -mr-2" src="{{ .RelPermalink }}" width="{{ .Width }}" height="{{ .Height }}" alt="Link to {{ $.Permalink }}">
{{ with images.QR .Permalink (dict "targetDir" "images/qr") }}
<img class="mb-2 -mr-2" src="{{ .RelPermalink }}" width="{{ .Width | mul 0.75 | int }}" height="{{ .Height | mul 0.75 | int }}" alt="Link to {{ $.Permalink }}">
{{ end }}
</div>
{{end }}