-
Notifications
You must be signed in to change notification settings - Fork 74
/
contentlayer.config.ts
121 lines (115 loc) · 3.39 KB
/
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
import {
defineDocumentType,
defineNestedType,
makeSource,
} from 'contentlayer/source-files';
import { DocParser } from './src/lib/md-parser';
const ParentType = defineNestedType(() => ({
name: 'Parent',
fields: {
label: {
type: 'string',
required: true,
},
link: {
type: 'string',
required: true,
},
},
}));
const MdDoc = defineDocumentType(() => ({
name: 'MdDoc',
filePathPattern: '**/*.{md,mdx}',
contentType: 'markdown',
fields: {
title: {
type: 'string',
description: 'The title of the doc',
required: false,
},
category: {
type: 'string',
description: 'The category of the doc',
required: false,
},
parent: {
type: 'nested',
of: ParentType,
required: false,
},
},
computedFields: {
slug: {
type: 'string',
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
resolve: (doc: any) => DocParser.createSlug(doc._raw.flattenedPath),
},
},
}));
const includeDirs = [
// DEFAULT DOCS & GUIDES
'docs/sway/docs/book/src',
'docs/fuels-rs/docs/src',
'docs/fuels-ts/apps/docs/src',
'docs/fuel-specs/src',
'docs/fuel-graphql-docs/docs',
'docs/fuels-wallet/packages/docs/docs',
'docs/guides/docs',
'docs/intro',
'docs/contributing',
'docs/sway-libs/docs/book/src',
'docs/sway-standards/docs/src',
'docs/sway-by-example-lib/docs/src',
'docs/migrations-and-disclosures/docs/src',
'docs/fuel-book/docs/src',
'docs/verified-addresses/docs/src',
'docs/integration-docs/docs/src',
// NIGHTLY DOCS
'docs/nightly/sway/docs/book/src',
'docs/nightly/fuels-rs/docs/src',
'docs/nightly/fuels-ts/apps/docs/src',
'docs/nightly/fuel-specs/src',
'docs/nightly/fuel-graphql-docs/docs',
'docs/nightly/fuels-wallet/packages/docs/docs',
'docs/nightly/sway-libs/docs/book/src',
'docs/nightly/sway-standards/docs/src',
'docs/nightly/sway-by-example-lib/docs/src',
'docs/nightly/migrations-and-disclosures/docs/src',
'docs/nightly/fuel-book/docs/src',
'docs/nightly/verified-addresses/docs/src',
'docs/nightly/integration-docs/docs/src',
];
const excludeDirs = [
// DEFAULT DOCS & GUIDES
'docs/guides/docs/guides.json',
'docs/guides/docs/nav.json',
'docs/intro/nav.json',
'docs/contributing/nav.json',
'docs/sway/docs/book/src/SUMMARY.md',
'docs/fuels-rs/docs/src/SUMMARY.md',
'docs/fuel-specs/src/SUMMARY.md',
'docs/sway-libs/docs/book/src/SUMMARY.md',
'docs/sway-standards/docs/src/SUMMARY.md',
'docs/sway-by-example-lib/docs/src/SUMMARY.md',
'docs/migrations-and-disclosures/docs/src/SUMMARY.md',
'docs/fuel-book/docs/src/SUMMARY.md',
'docs/verified-addresses/docs/src/SUMMARY.md',
'docs/integration-docs/docs/src/SUMMARY.md',
// NIGHTLY DOCS
'docs/nightly/sway/docs/book/src/SUMMARY.md',
'docs/nightly/fuels-rs/docs/src/SUMMARY.md',
'docs/nightly/fuel-specs/src/SUMMARY.md',
'docs/nightly/sway-libs/docs/book/src/SUMMARY.md',
'docs/nightly/sway-standards/docs/src/SUMMARY.md',
'docs/nightly/sway-by-example-lib/docs/src/SUMMARY.md',
'docs/nightly/migrations-and-disclosures/docs/src/SUMMARY.md',
'docs/nightly/fuel-book/docs/src/SUMMARY.md',
'docs/nightly/verified-addresses/docs/src/SUMMARY.md',
'docs/nightly/integration-docs/docs/src/SUMMARY.md',
];
export default makeSource({
contentDirPath: './',
contentDirInclude: includeDirs,
contentDirExclude: excludeDirs,
documentTypes: [MdDoc],
});