File tree Expand file tree Collapse file tree 3 files changed +17
-1
lines changed Expand file tree Collapse file tree 3 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ export const blogPosts = defineCollections({
2626 schema : frontmatterSchema . extend ( {
2727 author : z . string ( ) ,
2828 category : z . enum ( [ "devlog" , "updates" , "other" ] ) ,
29+ keywords : z . string ( ) . array ( ) . optional ( ) ,
2930 } ) ,
3031} )
3132
Original file line number Diff line number Diff line change @@ -2,9 +2,24 @@ import { lastEdit } from "@/lib/api"
22import { blog } from "@/lib/source"
33import { getMDXComponents } from "@/mdx-components"
44import { PathUtils } from "fumadocs-core/source"
5+ import type { Metadata , ResolvingMetadata } from "next"
56import Link from "next/link"
67import { notFound } from "next/navigation"
78
9+ export async function generateMetadata (
10+ { params } : PageProps < "/blog/[slug]" > ,
11+ parent : ResolvingMetadata ,
12+ ) : Promise < Metadata > {
13+ const { slug } = await params
14+ const page = blog . getPage ( [ slug ] )
15+
16+ return {
17+ title : page ?. data . title ,
18+ description : page ?. data . description ,
19+ keywords : page ?. data . keywords ,
20+ }
21+ }
22+
823export default async function Page ( props : PageProps < "/blog/[slug]" > ) {
924 const params = await props . params
1025 const page = blog . getPage ( [ params . slug ] )
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ export async function getRSS() {
2626 date : await lastEdit ( page ) ,
2727 author : [
2828 {
29- name : page . data . author
29+ name : page . data . author ,
3030 } ,
3131 ] ,
3232 } )
You can’t perform that action at this time.
0 commit comments