-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcontentlayer.config.ts
91 lines (87 loc) · 2.58 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
import {
defineDocumentType,
makeSource,
defineNestedType,
} from "contentlayer/source-files";
import rehypeSlug from "rehype-slug";
export const Doc = defineDocumentType(() => ({
name: "Doc",
description: "Base document type",
filePathPattern: `pages/**/*.mdx`,
contentType: "mdx",
fields: {
title: {
type: "string",
required: true,
description: "Page h1 and title metadata.",
},
slug: {
type: "string",
required: true,
description: "Page URL (independent from the filename).",
},
description: {
type: "string",
required: true,
description: "Page lede and description metadata.",
},
navigation: {
type: "string",
default: "default",
description: "Deprecated.",
},
gate: {
type: "string",
description:
"The gate that must be passed to access this page needs to a string that matches the GateType", // see @ts/gate for the an enum of available gates
},
unpublished: {
type: "boolean",
default: false,
description: "Indicates whether a page should NOT be published.",
},
no_index: {
type: "boolean",
default: false,
description:
"Indicates that a page is published but NOT present in sitemap and not indexed.",
},
redirect_from: {
type: "list",
of: {
type: "string",
},
description: "List of old URLs that will be redirected to `slug`.",
},
// These are temporary extra fields that may occur in the UI libraries section
// We should create separate collections for different types of content after cleaning up.
flavor: {
type: "enum",
options: ["android", "angular", "flutter", "ios", "js", "react", "vue"],
description: "The InstantSearch variant.",
},
short_description: {
type: "string",
description: "Deprecated. Use the `description` field instead.",
},
storybook_link: {
type: "string",
description: "URL to the Storybook page for an InstantSearch widget.",
},
demo_link: {
type: "string",
description: "URL to a demo for a widget or component.",
},
sandpack_link: {
type: "string",
description: "Link to an interactive code sandbox.",
},
},
}));
export default makeSource(async () => ({
contentDirPath: "./content",
documentTypes: [Doc],
mdx: {
rehypePlugins: [rehypeSlug],
},
}));