Merge pull request #1023 from timlrx/fix/contentlayer-toc-type

Fix contentlayer toc type
This commit is contained in:
Timothy 2024-09-12 23:12:34 +08:00 committed by GitHub
commit 250a4c50f9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 2100 additions and 1611 deletions

View File

@ -54,7 +54,7 @@ const computedFields: ComputedFields = {
type: 'string',
resolve: (doc) => doc._raw.sourceFilePath,
},
toc: { type: 'string', resolve: (doc) => extractTocHeadings(doc.body.raw) },
toc: { type: 'json', resolve: (doc) => extractTocHeadings(doc.body.raw) },
}
/**

View File

@ -18,14 +18,14 @@
"@tailwindcss/typography": "^0.5.12",
"autoprefixer": "^10.4.13",
"body-scroll-lock": "^4.0.0-beta.0",
"contentlayer2": "0.4.6",
"contentlayer2": "0.5.1",
"esbuild": "0.20.2",
"github-slugger": "^2.0.0",
"gray-matter": "^4.0.2",
"hast-util-from-html-isomorphic": "^2.0.0",
"image-size": "1.0.0",
"next": "14.2.3",
"next-contentlayer2": "0.4.6",
"next-contentlayer2": "0.5.1",
"next-themes": "^0.3.0",
"pliny": "0.2.1",
"postcss": "^8.4.24",

3705
yarn.lock

File diff suppressed because it is too large Load Diff