Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Commit 06a6011

Browse files
committed
wip conversion with fixes
1 parent 6edf23a commit 06a6011

File tree

1,163 files changed

+55232
-546
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,163 files changed

+55232
-546
lines changed

contentlayer.config.ts

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { defineDocumentType, makeSource } from 'contentlayer2/source-files'
22
import { extractTocHeadings } from './src/mdx/remark-toc-headings.mjs'
3-
import { title } from 'radash'
43
import path from 'path'
54
import fs from 'fs'
65

@@ -12,13 +11,10 @@ const Doc = defineDocumentType(() => ({
1211
name: 'Doc',
1312
filePathPattern: '**/*.mdx',
1413
fields: {
15-
title: {
16-
type: 'string',
17-
description: 'The meta title of the doc',
18-
},
19-
nav_title: {
14+
title_seo: {
2015
type: 'string',
21-
description: 'The title of the doc in the navigation',
16+
description:
17+
'The meta title of the doc, this will override the title extracted from the markdown and the nav title',
2218
},
2319
description: {
2420
type: 'string',
@@ -43,6 +39,14 @@ const Doc = defineDocumentType(() => ({
4339
resolve: (doc) => doc._raw.flattenedPath,
4440
},
4541
toc: { type: 'json', resolve: (doc) => extractTocHeadings(doc.body.raw) },
42+
title: {
43+
type: 'string',
44+
resolve: async (doc) => {
45+
const headings = await extractTocHeadings(doc.body.raw, [1])
46+
47+
return headings[0]?.value
48+
},
49+
},
4650
editUrl: {
4751
type: 'string',
4852
resolve: (doc) =>

0 commit comments

Comments
 (0)