Skip to content

Commit 796f221

Browse files
committed
refactor(layout): clean up layout code and improve formatting
1 parent 84a1ffd commit 796f221

File tree

5 files changed

+19
-13
lines changed

5 files changed

+19
-13
lines changed

src/app/(home)/blog/[slug]/page.tsx

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ export default async function Page(props: PageProps<"/blog/[slug]">) {
1717
<div className="grid gap-10 lg:grid-cols-[minmax(0,1fr)_280px]">
1818
<div className="max-w-3xl">
1919
<nav className="mb-6 text-sm text-neutral-500">
20-
<a className="hover:text-white" href="/blog">Blog</a>
20+
<a className="hover:text-white" href="/blog">
21+
Blog
22+
</a>
2123
<span className="mx-2">/</span>
2224
<span className="text-neutral-400">{page?.data.title}</span>
2325
</nav>
@@ -39,8 +41,13 @@ export default async function Page(props: PageProps<"/blog/[slug]">) {
3941
<div className="h-4 w-px bg-white/10" />
4042
<time>
4143
{new Date(
42-
await lastEdit(page) ?? PathUtils.basename(page.path, PathUtils.extname(page.path)),
43-
).toLocaleDateString("en-US", { month: "long", day: "numeric", year: "numeric" })}
44+
(await lastEdit(page)) ??
45+
PathUtils.basename(page.path, PathUtils.extname(page.path)),
46+
).toLocaleDateString("en-US", {
47+
month: "long",
48+
day: "numeric",
49+
year: "numeric",
50+
})}
4451
</time>
4552
</div>
4653
</div>

src/app/(home)/blog/page.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ function getName(path: string) {
1111

1212
export default async function Blog() {
1313
const pages = blog.getPages()
14-
14+
1515
const postsWithDates = await Promise.all(
1616
pages.map(async (page) => ({
1717
page,
1818
lastEditDate: await lastEdit(page),
19-
}))
19+
})),
2020
)
21-
21+
2222
const posts = postsWithDates.sort(
2323
(a, b) =>
2424
new Date(b.lastEditDate ?? getName(b.page.path)).getTime() -
@@ -35,7 +35,7 @@ export default async function Blog() {
3535
url: p.page.url,
3636
date: p.lastEditDate,
3737
},
38-
}))
38+
})),
3939
)
4040

4141
return (

src/app/(home)/layout.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ export default function Layout({ children }: { children: ReactNode }) {
1111
links={[
1212
{
1313
type: "icon",
14-
icon: <RssIcon/>,
14+
icon: <RssIcon />,
1515
text: "Blog",
16-
url: "/blog"
16+
url: "/blog",
1717
},
1818
{
1919
type: "icon",

src/app/layout.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@ export const metadata: Metadata = {
2121
{ url: "/android-chrome-192x192.png", sizes: "192x192" },
2222
{ url: "/android-chrome-512x512.png", sizes: "512x512" },
2323
],
24-
apple: [
25-
{ url: "/apple-touch-icon.png" }
26-
]
24+
apple: [{ url: "/apple-touch-icon.png" }],
2725
},
2826
}
2927

src/lib/rss.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ export function getRSS() {
99
id: `${baseUrl}/blog`,
1010
link: `${baseUrl}/blog`,
1111
language: "en",
12-
description: "Our blog where we post about more or less technical stuff regarding our plugins and minecraft in general",
12+
description:
13+
"Our blog where we post about more or less technical stuff regarding our plugins and minecraft in general",
1314
image: `${baseUrl}/banner.png`,
1415
favicon: `${baseUrl}/icon.png`,
1516
copyright: "All rights reserved 2025, TheNextLvl",

0 commit comments

Comments
 (0)