-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpage.tsx
64 lines (59 loc) · 1.79 KB
/
page.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
import { PageLayout } from "@/components/PageLayout";
import { InnerPage } from "@/components/InnerPage";
import { getBlogPosts } from "@/lib/blog";
import { BlogCard } from "@/components/BlogCard";
import { Link } from "@/components/Link";
export const metadata = {
title: "Blog",
description:
"A collection of blog posts that I have written alongside some general thoughts and links.",
};
async function getData() {
const posts = await getBlogPosts(false);
return {
posts,
};
}
export default async function Home() {
const data = await getData();
return (
<PageLayout>
<InnerPage>
<h1 className="text-2xl md:text-4xl font-bold text-primary-foreground">
Blog
</h1>
<div className="grid grid-cols-5 gap-4">
<div className="col-span-5 md:col-span-3 lg:col-span-4 pt-5">
<div className="text-primary-foreground lg:max-w-[75%]">
<p>
I've been running my own blogs since 2011, I started off with my
own technology blog called TechNutty. I worked on that for just
short of 7 years, during which time I also ran this personal
site and have been updating it since.
</p>
<p>
Check out my latest posts below, if you prefer RSS, you can find
a <Link href="/rss">feed for that here</Link>.
</p>
</div>
</div>
</div>
{data?.posts && (
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
{data.posts.map((post) => (
<BlogCard key={post.slug} post={post} />
))}
</div>
)}
<p className="text-muted-foreground pt-5">
By default, archived posts are not shown. If you would like to see
them, you can do so by clicking{" "}
<Link href="/blog/archived" muted>
here
</Link>
.
</p>
</InnerPage>
</PageLayout>
);
}