File tree Expand file tree Collapse file tree 4 files changed +10
-8
lines changed
Expand file tree Collapse file tree 4 files changed +10
-8
lines changed Original file line number Diff line number Diff line change 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" ,
Original file line number Diff line number Diff 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 } )
Original file line number Diff line number Diff line change 11export 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 {
Original file line number Diff line number Diff line change 77 scroll-behavior : smooth;
88}
99
10+ button {
11+ cursor : pointer;
12+ }
13+
1014@theme {
1115 --color-dark : # 17171c ;
1216 --color-buape : # 3f4fab ;
You can’t perform that action at this time.
0 commit comments