-
Notifications
You must be signed in to change notification settings - Fork 4
/
_cms.ts
176 lines (164 loc) · 4.23 KB
/
_cms.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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
import lumeCMS from "lume/cms/mod.ts";
import contactBlock from "./src/_includes/blocks/contact/fields.ts";
import faqBlock from "./src/_includes/blocks/faq/fields.ts";
import heroBlock from "./src/_includes/blocks/hero/fields.ts";
import imageTextBlock from "./src/_includes/blocks/imagetext/fields.ts";
import locationBlock from "./src/_includes/blocks/location/fields.ts";
import logosBlock from "./src/_includes/blocks/logos/fields.ts";
import pdfBlock from "./src/_includes/blocks/pdf/fields.ts";
import textBlock from "./src/_includes/blocks/text/fields.ts";
import videoBlock from "./src/_includes/blocks/video/fields.ts";
import separatorBlock from "./src/_includes/blocks/separator/fields.ts";
import calendarBlock from "./src/_includes/blocks/calendar/fields.ts";
import speakersBlock from "./src/_includes/blocks/speakers/fields.ts";
import ticketsBlock from "./src/_includes/blocks/tickets/fields.ts";
import peopleBlock from "./src/_includes/blocks/people/fields.ts";
import activitiesBlock from "./src/_includes/blocks/activities/fields.ts";
import headerBlock from "./src/_includes/blocks/header/fields.ts";
import multiTrackCalendarBlock from "./src/_includes/blocks/multitrack-calendar/fields.ts";
const blocks = {
type: "choose-list",
name: "blocks",
description: "Blocks with the content of the page",
fields: [
headerBlock,
activitiesBlock,
contactBlock,
calendarBlock,
multiTrackCalendarBlock,
faqBlock,
heroBlock,
imageTextBlock,
locationBlock,
logosBlock,
peopleBlock,
separatorBlock,
speakersBlock,
ticketsBlock,
pdfBlock,
textBlock,
videoBlock,
],
};
const metas = {
type: "object",
name: "metas",
description: "Meta tags for SEO and social media sharing",
view: "more",
fields: [
"title: text",
"description: text",
{
type: "file",
name: "image",
description: "Image for sharing on social media (empty for default)",
},
],
};
const styles = {
type: "code",
name: "extra_head",
description: "Extra HTML code to include in the head of the page",
view: "more",
};
const menu = {
type: "object-list",
name: "menu",
description: "Items for the menu bar",
view: "more",
fields: [
"text: text",
"url: text",
"highlight: checkbox",
],
};
const state = {
type: "select",
label: "Visibility",
name: "only_state",
description: "When should this page be visible?",
options: [
{ label: "Always", value: "" },
{ label: "Before the event", value: "pre-event" },
{ label: "During the event", value: "event" },
{ label: "After the event", value: "post-event" },
{ label: "Never", value: "never" },
],
};
const cms = lumeCMS();
cms.collection({
name: "Pages",
store: "src:block_pages/*.yml",
fields: [
"title: text",
{
name: "url",
type: "text",
description: "Public URL of the page",
},
styles,
metas,
state,
menu,
blocks,
],
});
cms.collection("Legal pages", "src:pages/*.md", [
"title: text",
state,
styles,
"subtitle: text",
"content: markdown",
]);
cms.document({
name: "Settings",
description: "General settings",
store: "src:_data.yml",
fields: [
{
type: "text",
name: "title_suffix",
description: "Default title or suffix for all pages",
},
{
type: "select",
name: "state",
description: "Event state. This will filter the pages by state",
options: [
{ label: "Before the event", value: "pre-event" },
{ label: "During the event", value: "event" },
{ label: "After the event", value: "post-event" },
],
},
{
type: "object",
name: "cta",
description: "Call to action (visible on all pages)",
fields: [
"text: text",
"url: text",
],
},
{
type: "object",
name: "footer",
description: "Footer settings (copyright, menu)",
fields: [
"copyright: markdown",
{
type: "object-list",
name: "menu",
fields: [
"text: text",
"href: text",
],
},
],
},
],
});
cms.document("Humans.txt", "src:humans.vto", [
"content: code",
]);
cms.upload("Uploads", "src:files");
export default cms;