Skip to content

Commit 56f612c

Browse files
authored
www: fix footer to the bottom when content is short (#271)
1 parent f9559b1 commit 56f612c

File tree

2 files changed

+17
-11
lines changed

2 files changed

+17
-11
lines changed

www/routes/docs/[...slug].tsx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,12 @@ export default function DocsPage(props: PageProps<Data>) {
6666
<link rel="stylesheet" href={`/gfm.css?build=${__FRSH_BUILD_ID}`} />
6767
{description && <meta name="description" content={description} />}
6868
</Head>
69-
<Header />
70-
<NavigationBar active="/docs" />
71-
<Main path={props.url.pathname} page={props.data.page} />
72-
<Footer />
69+
<div class={tw`flex flex-col min-h-screen`}>
70+
<Header />
71+
<NavigationBar active="/docs" />
72+
<Main path={props.url.pathname} page={props.data.page} />
73+
<Footer />
74+
</div>
7375
</>
7476
);
7577
}
@@ -152,13 +154,13 @@ function Title() {
152154
function Main(props: { path: string; page: Page }) {
153155
const main = tw`mx-auto max-w-screen-lg px-4 flex gap-6`;
154156
return (
155-
<>
157+
<div class={tw`flex-1`}>
156158
<MobileSidebar path={props.path} />
157159
<div class={main}>
158160
<DesktopSidebar path={props.path} />
159161
<Content page={props.page} />
160162
</div>
161-
</>
163+
</div>
162164
);
163165
}
164166

www/routes/index.tsx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,15 @@ export default function MainPage(props: PageProps) {
4444
<meta property="og:url" content={props.url.href} />
4545
<meta property="og:image" content={ogImageUrl} />
4646
</Head>
47-
<Hero />
48-
<Intro />
49-
<GettingStarted origin={origin} />
50-
<Example />
51-
<Footer />
47+
<div class={tw`flex flex-col min-h-screen`}>
48+
<Hero />
49+
<div class={tw`flex-1`}>
50+
<Intro />
51+
<GettingStarted origin={origin} />
52+
<Example />
53+
</div>
54+
<Footer />
55+
</div>
5256
</>
5357
);
5458
}

0 commit comments

Comments
 (0)