Let a blog post be downloaded as a PDF
Download PDF beside the byline opens the browser's print dialog (Save as PDF) with a print layout: the site's header, footer and notices hidden, the contents column dropped, the light palette whatever the screen shows, and at the bottom the post's link and a QR code of it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
c03914a210
commit
5dceeb5860
4 changed files with 61 additions and 7 deletions
|
|
@ -74,7 +74,7 @@ export default function PostContents({ entries }: { entries: ContentsEntry[] })
|
|||
const lit = useLit(entries)
|
||||
return (
|
||||
<>
|
||||
<details className="rounded-2xl border border-brand/20 bg-tint-soft p-4 lg:hidden">
|
||||
<details className="rounded-2xl border border-brand/20 bg-tint-soft p-4 lg:hidden print:hidden">
|
||||
<summary className="cursor-pointer font-semibold text-ink">On this page</summary>
|
||||
<div className="mt-3">
|
||||
<List entries={entries} lit={lit} />
|
||||
|
|
@ -82,7 +82,7 @@ export default function PostContents({ entries }: { entries: ContentsEntry[] })
|
|||
</details>
|
||||
<nav
|
||||
aria-label="On this page"
|
||||
className="sticky hidden self-start lg:block"
|
||||
className="sticky hidden self-start lg:block print:hidden"
|
||||
style={{ top: 'calc(var(--header-h, 5rem) + 1.5rem)' }}
|
||||
>
|
||||
<p className="mb-2 px-3 text-sm font-semibold text-ink">On this page</p>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue