forked from rainbow-me/rainbowkit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontentlayer.config.ts
36 lines (34 loc) · 901 Bytes
/
contentlayer.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/* eslint-disable sort-keys-fix/sort-keys-fix */
import { defineDocumentType, makeSource } from 'contentlayer/source-files';
import remarkSlug from 'remark-slug';
import { rehypeHighlightCode } from './lib/rehype-highlight-code';
import { rehypeMetaAttribute } from './lib/rehype-meta-attribute';
export const Doc = defineDocumentType(() => ({
name: 'Doc',
filePathPattern: `docs/**/*.mdx`,
contentType: 'mdx',
fields: {
title: {
type: 'string',
required: true,
},
description: {
type: 'string',
required: false,
},
},
computedFields: {
slug: {
type: 'string',
resolve: doc => doc._raw.flattenedPath.replace('docs/', ''),
},
},
}));
export default makeSource({
contentDirPath: 'data',
documentTypes: [Doc],
mdx: {
remarkPlugins: [remarkSlug],
rehypePlugins: [rehypeMetaAttribute, rehypeHighlightCode],
},
});