44 Revision ,
55 RevisionPageDocument ,
66 RevisionPageGroup ,
7+ SiteCustomizationSettings ,
78 Space ,
89} from '@gitbook/api' ;
910import { Metadata } from 'next' ;
@@ -16,7 +17,13 @@ import { TrademarkLink } from '@/components/TableOfContents/Trademark';
1617import { PolymorphicComponentProp } from '@/components/utils/types' ;
1718import { getSpaceLanguage } from '@/intl/server' ;
1819import { tString } from '@/intl/translate' ;
19- import { getDocument , getSpace , getSpaceCustomization , getSpaceContentData } from '@/lib/api' ;
20+ import {
21+ getDocument ,
22+ getSpace ,
23+ getSpaceCustomization ,
24+ getSpaceContentData ,
25+ getSiteSpaceCustomization ,
26+ } from '@/lib/api' ;
2027import { pagePDFContainerId , PageHrefContext , absoluteHref } from '@/lib/links' ;
2128import { resolvePageId } from '@/lib/pages' ;
2229import { ContentRefContext , resolveContentRef } from '@/lib/references' ;
@@ -35,7 +42,9 @@ export async function generateMetadata(): Promise<Metadata> {
3542 const contentPointer = getContentPointer ( ) ;
3643 const [ space , customization ] = await Promise . all ( [
3744 getSpace ( contentPointer . spaceId ) ,
38- getSpaceCustomization ( contentPointer . spaceId ) ,
45+ 'siteId' in contentPointer
46+ ? getSiteSpaceCustomization ( contentPointer )
47+ : getSpaceCustomization ( contentPointer . spaceId ) ,
3948 ] ) ;
4049
4150 return {
@@ -59,7 +68,9 @@ export default async function PDFHTMLOutput(props: { searchParams: { [key: strin
5968
6069 // Load the content,
6170 const [ customization , { space, contentTarget, pages : rootPages } ] = await Promise . all ( [
62- getSpaceCustomization ( contentPointer . spaceId ) ,
71+ 'siteId' in contentPointer
72+ ? getSiteSpaceCustomization ( contentPointer )
73+ : getSpaceCustomization ( contentPointer . spaceId ) ,
6374 getSpaceContentData ( contentPointer ) ,
6475 ] ) ;
6576 const language = getSpaceLanguage ( customization ) ;
@@ -172,7 +183,10 @@ export default async function PDFHTMLOutput(props: { searchParams: { [key: strin
172183 ) ;
173184}
174185
175- async function PDFSpaceIntro ( props : { space : Space ; customization : CustomizationSettings } ) {
186+ async function PDFSpaceIntro ( props : {
187+ space : Space ;
188+ customization : CustomizationSettings | SiteCustomizationSettings ;
189+ } ) {
176190 const { space, customization } = props ;
177191
178192 return (
0 commit comments