Skip to content

Commit 75b1a2a

Browse files
fix build error
1 parent ff0482d commit 75b1a2a

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
"postinstall": "fumadocs-mdx",
1313
"dev": "next dev",
1414
"lint": "biome check . --write --diagnostic-level=warn",
15-
"typecheck": "tsc --noEmit"
15+
"typecheck": "tsc --noEmit",
16+
"start": "next start"
1617
},
1718
"dependencies": {
1819
"@radix-ui/react-slot": "1.2.3",

src/app/blog/[slug]/page.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,17 +77,14 @@ export async function generateMetadata(props: {
7777

7878
if (!page) notFound()
7979

80-
const staff = await fetch("https://internal.buape.com/staff", {
81-
next: { revalidate: 3600 }
82-
}).then((res) => res.json())
83-
84-
const author = staff.data.staff.find(
80+
const staff = await getStaff()
81+
const author = staff?.data.staff.find(
8582
(x: { id: string }) => x.id === page.data.authorId
8683
)
8784

8885
return createMetadata({
8986
title: `Blog: ${page.data.title}`,
90-
description: `${page.data.description}\n\nWritten by ${author.username} on ${new Date(
87+
description: `${page.data.description}\n\nWritten by ${author?.username || page.data.authorId} on ${new Date(
9188
page.data.date.valueOf() + page.data.date.getTimezoneOffset()
9289
).toLocaleDateString()}`
9390
})

src/lib/staff.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export async function getStaff() {
22
const res = await fetch("https://internal.buape.com/staff", {
3-
cache: "no-store"
3+
next: { revalidate: 3600 }
44
})
55
if (res.ok) {
66
return (await res.json()) as {

src/styles/globals.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ html {
77
scroll-behavior: smooth;
88
}
99

10+
button {
11+
cursor: pointer;
12+
}
13+
1014
@theme {
1115
--color-dark: #17171c;
1216
--color-buape: #3f4fab;

0 commit comments

Comments
 (0)