11---
22export const prerender = true
33
4+ import { GENERATE_PDFS } from ' astro:env/server'
45import { type CollectionEntry , getCollection , getEntry , render } from ' astro:content'
56import type { MarkdownHeading } from ' astro'
67import { Image , Picture } from ' astro:assets'
78import { isDev } from ' @lib/config/environmentServer'
8- import PrintLayout from ' @layouts/PrintLayout.astro'
9- import Cover from ' @components/Layout/Print/Cover/index.astro'
10- import PrintToc from ' @components/Layout/Print/Toc/index.astro'
9+
1110import Copyright from ' @components/Layout/Copyright/index.astro'
11+ import Cover from ' @components/Layout/Print/Cover/index.astro'
12+ import PrintLayout from ' @layouts/PrintLayout.astro'
1213import QrCode from ' @components/QrCode/index.astro'
14+ import Toc from ' @components/Layout/Print/Toc/index.astro'
1315
1416/** MDX components that are safe for static PDF rendering (no web components) */
1517import Avatar from ' @components/Avatar/index.astro'
1618import Button from ' @components/Button/index.astro'
1719import Callout from ' @components/Callout/index.astro'
20+ import CodeTabs from ' @components/Code/CodeTabs/index.astro'
1821import Copy from ' @components/Copy/index.astro'
1922import Diagram from ' @components/Diagram/index.astro'
2023import Icon from ' @components/Icon/index.astro'
@@ -23,7 +26,6 @@ import List from '@components/List/index.astro'
2326import ListItem from ' @components/List/ListItem.astro'
2427import Table from ' @components/Table/index.astro'
2528import Time from ' @components/Time/index.astro'
26- import CodeTabs from ' @components/Code/CodeTabs/index.astro'
2729
2830const PdfComponents = {
2931 Avatar ,
@@ -48,7 +50,7 @@ export interface Props {
4850
4951/** Generate static paths for all deep-dive articles */
5052export async function getStaticPaths() {
51- if (! isDev () && ! import . meta . env . GENERATE_PDFS ) {
53+ if (! isDev () && ! GENERATE_PDFS ) {
5254 return []
5355 }
5456
@@ -75,7 +77,7 @@ const publishDate = article.data.publishDate
7577 <Cover article ={ article } authorName ={ author .data .name } />
7678
7779 { /* Table of contents — page numbers injected by the PDF generation script */ }
78- <PrintToc headings ={ tocHeadings } />
80+ <Toc headings ={ tocHeadings } />
7981
8082 { /* Article body */ }
8183 <article class =" print-article markdown-content__prose" >
0 commit comments