theme: Add title and QR code when printing

This commit is contained in:
Joe Mooring 2025-03-07 15:19:02 -08:00 committed by Joe Mooring
parent bd46ef6265
commit aef899bc54
2 changed files with 10 additions and 1 deletions

View File

@ -48,7 +48,8 @@
{{ end }}
<div class="flex w-full xl:w-6xl h-full flex-auto mx-auto">
<main
class="flex-1 mx-auto lg:mx-0 w-full max-w-3x lg:max-w-3x pt-8 lg:pt-14 pb-20 px-main">
class="flex-1 mx-auto lg:mx-0 w-full max-w-3x lg:max-w-3x pt-8 lg:pt-14 pb-20 px-main print:pt-0">
{{ partial "layouts/hooks/body-main-start.html" . }}
{{ block "main" . }}{{ end }}
</main>
{{ block "rightsidebar" . }}

View File

@ -0,0 +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 }}">
{{ end }}
</div>
{{end }}