Skip to content

Commit 250a4c5

Browse files
authored
Merge pull request #1023 from timlrx/fix/contentlayer-toc-type
Fix contentlayer toc type
2 parents 142c14c + c8c0d9c commit 250a4c5

File tree

3 files changed

+2087
-1598
lines changed

3 files changed

+2087
-1598
lines changed

contentlayer.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ const computedFields: ComputedFields = {
5454
type: 'string',
5555
resolve: (doc) => doc._raw.sourceFilePath,
5656
},
57-
toc: { type: 'string', resolve: (doc) => extractTocHeadings(doc.body.raw) },
57+
toc: { type: 'json', resolve: (doc) => extractTocHeadings(doc.body.raw) },
5858
}
5959

6060
/**

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@
1818
"@tailwindcss/typography": "^0.5.12",
1919
"autoprefixer": "^10.4.13",
2020
"body-scroll-lock": "^4.0.0-beta.0",
21-
"contentlayer2": "0.4.6",
21+
"contentlayer2": "0.5.1",
2222
"esbuild": "0.20.2",
2323
"github-slugger": "^2.0.0",
2424
"gray-matter": "^4.0.2",
2525
"hast-util-from-html-isomorphic": "^2.0.0",
2626
"image-size": "1.0.0",
2727
"next": "14.2.3",
28-
"next-contentlayer2": "0.4.6",
28+
"next-contentlayer2": "0.5.1",
2929
"next-themes": "^0.3.0",
3030
"pliny": "0.2.1",
3131
"postcss": "^8.4.24",

0 commit comments

Comments
 (0)