forked from CloudCannon/platform-documentation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cloudcannon.config.cjs
124 lines (122 loc) · 3.5 KB
/
cloudcannon.config.cjs
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
122
123
124
const path = require("path");
const _snippets = {
...require(path.join(__dirname, ".cloudcannon/snippets/code_block.json")),
...require(path.join(__dirname, ".cloudcannon/snippets/conditional.json")),
...require(path.join(__dirname, ".cloudcannon/snippets/data_reference.json")),
...require(path.join(__dirname, ".cloudcannon/snippets/docs_image.json")),
...require(path.join(__dirname, ".cloudcannon/snippets/multi_code_block.json")),
...require(path.join(__dirname, ".cloudcannon/snippets/notice.json")),
...require(path.join(__dirname, ".cloudcannon/snippets/tabs.json")),
...require(path.join(__dirname, ".cloudcannon/snippets/youtube.json")),
}
module.exports = {
_snippets_imports: {
mdx: true
},
_snippets,
collections_config: {
articles: {
path: 'articles',
output: true,
icon: 'article',
url: '/articles/[slug]/',
parser: 'front-matter',
schemas: {
default: {
path: ".cloudcannon/schemas/article.mdx"
}
}
},
guides: {
path: 'guides',
output: true,
icon: 'school',
url: '/guides/[relative_base_path]/[slug]/',
parser: 'front-matter'
},
changelog: {
path: 'changelogs',
output: true,
icon: 'tips_and_updates',
url: (filePath) => {
const regex = /^changelogs\/([0-9]{4})\-([0-9]{2})\-([0-9]{2})_(.+)\.mdx?/;
const [, year, month, day, slug] = filePath.match(regex) || [];
return `/changelog/${year}/${month}/${day}/${slug}.html`;
},
parser: 'front-matter',
sort: {
key: 'path',
order: 'desc'
},
create: {
path: '{date|year}-{date|month}-{date|day}_{title|slugify}.[ext]',
_inputs: {
date: {
instance_value: 'NOW'
}
}
},
schemas: {
default: {
path: ".cloudcannon/schemas/changelog.mdx"
}
}
},
data: {
path: '_data',
filter: {
base: 'none',
include: [
'navigation.yml',
'meta.yml',
'headingnav.yml',
'ssgs.yml'
]
}
}
},
_editables: {
content: {
format: true,
blockquote: true,
bold: true,
italic: true,
strike: true,
subscript: true,
superscript: true,
underline: true,
link: true,
bulletedlist: true,
numberedlist: true,
code: true,
embed: true,
horizontalrule: true,
image: true,
table: true,
snippet: true
}
},
_structures: {
related_links: {
values: {
value: {
name: '',
url: ''
}
}
}
},
_inputs: {
_created_at: {
instance_value: 'NOW',
},
_uuid: {
instance_value: 'UUID',
}
},
commit_templates: [
{template_string: '{message}'}
],
timezone: 'Pacific/Auckland',
base_url: 'documentation'
}