Skip to content

Commit 95d1243

Browse files
committed
Fix unthemed index pages.
1 parent 7ddd394 commit 95d1243

File tree

3 files changed

+23
-26
lines changed

3 files changed

+23
-26
lines changed

src/layouts/SiteLayout.astro

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ const {
2121
<ThemeBoot />
2222
</head>
2323

24-
<body class="min-h-screen antialiased bg-[--color-bg] text-[--color-fg]">
24+
<body class="min-h-dvh flex flex-col antialiased">
2525
<!-- Single outer box for consistent width across header/main/footer -->
26-
<div class="mx-auto max-w-7xl px-4">
26+
<div class="mx-auto w-full max-w-7xl px-4 flex flex-1 flex-col">
2727
<Header />
2828

29-
<main class="py-10">
29+
<main class="flex-1 py-10">
3030
<slot />
3131
</main>
3232

src/pages/blog/index.astro

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,19 @@
11
---
2-
import { getCollection } from 'astro:content';
3-
import { compareByDateThenOrder } from '@/lib/dates';
4-
5-
const posts = await getCollection('blog', ({ data }) => data.published !== false);
6-
const sorted = posts.sort((a, b) => compareByDateThenOrder(a.data, b.data));
2+
import SiteLayout from '@/layouts/SiteLayout.astro';
3+
import BlogList from "@/components/BlogList.astro";
74
---
85

9-
<html lang="en">
10-
<head><title>Blog</title></head>
11-
<body class="prose prose-invert max-w-3xl mx-auto p-6">
12-
<h1>Blog</h1>
13-
<ul class="not-prose space-y-4">
14-
{sorted.map((post) => (
15-
<li>
16-
<a href={`/blog/${post.slug}/`}>{post.data.title}</a>
17-
</li>
18-
))}
19-
</ul>
20-
</body>
21-
</html>
6+
<SiteLayout title="Vivarium - Blog">
7+
<main
8+
class="grid grid-cols-[1fr_3fr] gap-4 [&>*]:min-w-0 [&>*]:[overflow-wrap:anywhere]"
9+
>
10+
<aside class="hidden lg:block">
11+
<div class="sticky top-20 shrink-0 min-w-0 overflow-wrap:anywhere pe-2">
12+
<BlogList activeId="" />
13+
</div>
14+
</aside>
15+
<section>
16+
17+
</section>
18+
</main>
19+
</SiteLayout>

src/pages/docs/index.astro

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
---
2+
import SiteLayout from '@/layouts/SiteLayout.astro';
3+
24
import { getCollection } from "astro:content";
35
const docs = await getCollection("docs");
46
const byKind = {
@@ -18,9 +20,7 @@ for (const kind of Object.keys(byKind)) {
1820
}
1921
---
2022

21-
<html lang="en">
22-
<head><title>Docs</title></head>
23-
<body class="prose mx-auto p-6">
23+
<SiteLayout title="Vivarium - Blog">
2424
<h1>Documentation</h1>
2525

2626
<section>
@@ -59,5 +59,4 @@ for (const kind of Object.keys(byKind)) {
5959
))}
6060
</ul>
6161
</section>
62-
</body>
63-
</html>
62+
</SiteLayout>

0 commit comments

Comments
 (0)