@@ -43,38 +43,42 @@ export async function SitePage(props: SitePageProps) {
43
43
44
44
return (
45
45
< PageContextProvider pageId = { page . id } spaceId = { context . space . id } title = { page . title } >
46
- { withFullPageCover && page . cover ? (
47
- < PageCover as = "full" page = { page } cover = { page . cover } context = { context } />
48
- ) : null }
49
- { /* We use a flex row reverse to render the aside first because the page is streamed. */ }
50
- < div
51
- className = { tcls (
52
- 'flex grow flex-row-reverse justify-end' ,
53
- withSections
54
- ? '[--content-scroll-margin:calc(var(--spacing)*27)]'
55
- : '[--content-scroll-margin:calc(var(--spacing)*16)]'
56
- ) }
57
- >
58
- < PageAside
59
- page = { page }
60
- document = { document }
61
- withHeaderOffset = { headerOffset }
62
- withFullPageCover = { withFullPageCover }
63
- withPageFeedback = { withPageFeedback }
64
- context = { context }
65
- />
66
- < PageBody
67
- context = { context }
68
- page = { page }
69
- ancestors = { ancestors }
70
- document = { document }
71
- withPageFeedback = { withPageFeedback }
72
- insightsDisplayContext = { SiteInsightsDisplayContext . Site }
73
- />
46
+ { /* Using `contents` makes the children of this div according to its parent — which keeps them in a single flex row with the TOC by default.
47
+ If there's a page cover, we use `flex flex-col` to lay out the PageCover above the PageBody + PageAside instead. */ }
48
+ < div className = { withFullPageCover && page . cover ? 'flex grow flex-col' : 'contents' } >
49
+ { withFullPageCover && page . cover ? (
50
+ < PageCover as = "full" page = { page } cover = { page . cover } context = { context } />
51
+ ) : null }
52
+
53
+ < div
54
+ className = { tcls (
55
+ withFullPageCover && page . cover ? 'flex grow flex-row' : 'contents' ,
56
+ withSections
57
+ ? '[--content-scroll-margin:calc(var(--spacing)*27)]'
58
+ : '[--content-scroll-margin:calc(var(--spacing)*16)]'
59
+ ) }
60
+ >
61
+ < PageAside
62
+ page = { page }
63
+ document = { document }
64
+ withHeaderOffset = { headerOffset }
65
+ withFullPageCover = { withFullPageCover }
66
+ withPageFeedback = { withPageFeedback }
67
+ context = { context }
68
+ />
69
+ < PageBody
70
+ context = { context }
71
+ page = { page }
72
+ ancestors = { ancestors }
73
+ document = { document }
74
+ withPageFeedback = { withPageFeedback }
75
+ insightsDisplayContext = { SiteInsightsDisplayContext . Site }
76
+ />
77
+ </ div >
78
+ < React . Suspense fallback = { null } >
79
+ < PageClientLayout />
80
+ </ React . Suspense >
74
81
</ div >
75
- < React . Suspense fallback = { null } >
76
- < PageClientLayout />
77
- </ React . Suspense >
78
82
</ PageContextProvider >
79
83
) ;
80
84
}
0 commit comments