-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathkeystatic.config.ts
More file actions
255 lines (245 loc) · 9.8 KB
/
Copy pathkeystatic.config.ts
File metadata and controls
255 lines (245 loc) · 9.8 KB
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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
import { collection, config, fields } from '@keystatic/core';
const pathwayOptions = [
{ label: 'Getting Started with Open Source', value: 'getting-started' },
{ label: 'Contributing to a Project', value: 'contributing' },
{ label: 'Maintaining & Sustaining Software', value: 'maintaining' },
{ label: 'Strategic Practices & Career Development', value: 'strategic' },
] as const;
const educationalLevelOptions = [
{ label: 'Beginner', value: 'Beginner' },
{ label: 'Intermediate', value: 'Intermediate' },
{ label: 'Advanced', value: 'Advanced' },
] as const;
const domainOptions = [
{ label: 'Research Software', value: 'Research Software' },
{ label: 'Data Science', value: 'Data Science' },
{ label: 'Institutional Policy', value: 'Institutional Policy' },
{ label: 'GIS', value: 'GIS' },
{ label: 'General Open Source', value: 'General Open Source' },
] as const;
const learningResourceTypeOptions = [
{ label: 'Tutorial', value: 'tutorial' },
{ label: 'Workshop', value: 'workshop' },
{ label: 'Presentation', value: 'presentation' },
{ label: 'Handout', value: 'handout' },
{ label: 'Video Lecture', value: 'video lecture' },
{ label: 'e-Learning Module', value: 'e-Learning module' },
{ label: 'Quiz', value: 'quiz' },
{ label: 'Exercise', value: 'exercise' },
] as const;
const roleOptions = [
{ label: 'Developer', value: 'Developer' },
{ label: 'Contributor', value: 'Contributor' },
{ label: 'Community Manager', value: 'Community Manager' },
{ label: 'User/Consumer', value: 'User/Consumer' },
{ label: 'Maintainer', value: 'Maintainer' },
] as const;
const creativeWorkStatusOptions = [
{ label: 'Active', value: 'Active' },
{ label: 'Under development', value: 'Under development' },
{ label: 'Archived', value: 'Archived' },
] as const;
const languageOptions = [
{ label: 'English (en)', value: 'en' },
{ label: 'Bulgarian (bg)', value: 'bg' },
{ label: 'Bengali (bn)', value: 'bn' },
{ label: 'German (de)', value: 'de' },
{ label: 'Greek (el)', value: 'el' },
{ label: 'Spanish (es)', value: 'es' },
{ label: 'Persian (fa)', value: 'fa' },
{ label: 'French (fr)', value: 'fr' },
{ label: 'Hindi (hi)', value: 'hi' },
{ label: 'Hungarian (hu)', value: 'hu' },
{ label: 'Indonesian (id)', value: 'id' },
{ label: 'Italian (it)', value: 'it' },
{ label: 'Japanese (ja)', value: 'ja' },
{ label: 'Korean (ko)', value: 'ko' },
{ label: 'Malay (ms)', value: 'ms' },
{ label: 'Dutch (nl)', value: 'nl' },
{ label: 'Polish (pl)', value: 'pl' },
{ label: 'Portuguese (pt)', value: 'pt' },
{ label: 'Romanian (ro)', value: 'ro' },
{ label: 'Russian (ru)', value: 'ru' },
{ label: 'Swahili (sw)', value: 'sw' },
{ label: 'Tamil (ta)', value: 'ta' },
{ label: 'Turkish (tr)', value: 'tr' },
{ label: 'Chinese (Simplified) (zh-CN)', value: 'zh-CN' },
{ label: 'Chinese (Traditional) (zh-TW)', value: 'zh-TW' },
] as const;
const keepStatusOptions = [
{ label: 'Keep', value: 'keep' },
{ label: 'Keep candidate', value: 'keepCandidate' },
{ label: 'Drop', value: 'drop' },
] as const;
const useGitHubStorage =
import.meta.env.PUBLIC_KEYSTATIC_STORAGE === 'github' && import.meta.env.DEV;
export default config({
storage: useGitHubStorage
? { kind: 'github', repo: 'UC-OSPO-Network/education' }
: { kind: 'local' },
ui: {
brand: { name: 'UC OSPO Education' },
navigation: {
Content: ['lessons'],
},
},
collections: {
lessons: collection({
label: 'Lessons',
path: 'src/content/lessons/*',
format: { data: 'json' },
// Keep Keystatic's internal filename slug separate from the mirrored JSON `slug` key.
slugField: 'entrySlug',
schema: {
entrySlug: fields.text({
label: 'Entry Slug (filename)',
validation: { isRequired: true },
description:
'Internal Keystatic field for the file slug/path. Keep this aligned with filename slug.',
}),
name: fields.text({
label: 'Name',
validation: { isRequired: true },
description: 'The title of the lesson',
}),
slug: fields.text({
label: 'Slug (mirrored JSON)',
validation: { isRequired: true },
description:
'Mirrored slug key stored in JSON. Must match the filename slug.',
}),
keepStatus: fields.select({
label: 'Keep status',
options: keepStatusOptions,
defaultValue: 'keepCandidate',
}),
description: fields.text({ label: 'Description', multiline: true }),
url: fields.url({
label: 'Lesson URL',
validation: { isRequired: true },
}),
author: fields.text({
label: 'Author',
description:
'Use one of two forms: an organization or team name (e.g. "CodeRefinery Team"), ' +
'or a person as "Full Name <email@example.com>". For multiple people, separate with commas. ' +
'Do not append an email to an organization name.',
}),
provider: fields.text({
label: 'Provider (organization)',
description: 'Organization that produced this lesson (e.g. UC Davis DataLab, CodeRefinery). Follows Bioschemas TrainingMaterial provider field.',
}),
license: fields.text({ label: 'License' }),
pathways: fields.multiselect({
label: 'Pathways',
options: pathwayOptions,
description: 'One or more pathways this lesson belongs to.',
}),
educationalLevel: fields.select({
label: 'Skill level (educationalLevel)',
options: educationalLevelOptions,
defaultValue: 'Beginner',
}),
domain: fields.select({
label: 'Domain (topic area)',
options: domainOptions,
defaultValue: 'General Open Source',
description: 'High-level category for discovery filters.',
}),
roles: fields.multiselect({
label: 'OSS Roles',
options: roleOptions,
description: 'Standardized Bioschemas roles (select all that apply).',
}),
subTopic: fields.text({ label: 'Sub-topic' }),
timeRequired: fields.text({
label: 'Time Required',
description: 'ISO 8601 duration format. e.g. PT15M (15 mins), PT1H (1 hour), PT1H30M',
}),
learningResourceType: fields.select({
label: 'Learning resource type',
options: learningResourceTypeOptions,
defaultValue: 'tutorial',
description: 'Bioschemas standardized type.',
}),
inLanguage: fields.array(
fields.select({
label: 'Language',
options: languageOptions,
defaultValue: 'en',
}),
{
label: 'Languages',
itemLabel: (props) => props.value,
}
),
keywords: fields.array(fields.text({ label: 'Keyword' }), {
label: 'Keywords',
itemLabel: (props) => props.value,
}),
// --- Additional Metadata Fields ---
topic: fields.text({
label: 'Topic (Granular)',
description: 'Specific tool or sub-topic (e.g. QGIS, Python, Git)',
}),
sortingId: fields.text({ label: 'Sorting ID' }),
prerequisites: fields.array(
fields.object({
type: fields.select({
label: 'Type',
options: [
{ label: 'Lesson (slug)', value: 'lesson' },
{ label: 'External URL', value: 'url' },
{ label: 'Free text', value: 'text' },
],
defaultValue: 'lesson',
}),
value: fields.text({
label: 'Slug / URL / Text',
validation: { isRequired: true },
}),
label: fields.text({
label: 'Display label (optional)',
description: 'Override the link text shown to learners',
}),
}),
{
label: 'Prerequisites',
itemLabel: (props) => props.fields.value.value || props.fields.type.value,
description: 'Prerequisite lessons (slug), external URLs, or free-text notes',
}
),
prerequisiteNotes: fields.text({
label: 'Prerequisite Notes',
multiline: true,
description: 'Free-text prerequisite notes that are not machine-readable references',
}),
learningObjectives: fields.text({ label: 'Learning Objectives', multiline: true }),
ospoRelevance: fields.text({ label: 'OSPO Relevance', multiline: true }),
about: fields.text({ label: 'About' }),
abstract: fields.text({ label: 'Abstract', multiline: true }),
accessibilitySummary: fields.text({ label: 'Accessibility Summary', multiline: true }),
audience: fields.text({ label: 'Audience' }),
competencyRequired: fields.text({ label: 'Competency Required' }),
contributor: fields.text({ label: 'Contributor' }),
creativeWorkStatus: fields.select({
label: 'Creative Work Status (Lifecycle)',
options: creativeWorkStatusOptions,
defaultValue: 'Active',
}),
dateCreated: fields.text({ label: 'Date Created' }),
dateModified: fields.text({ label: 'Date Modified' }),
datePublished: fields.text({ label: 'Date Published' }),
hasPart: fields.text({ label: 'Has Part' }),
identifier: fields.text({ label: 'Identifier' }),
isPartOf: fields.text({ label: 'Is Part Of' }),
notes: fields.text({ label: 'Notes', multiline: true }),
mentions: fields.text({ label: 'Mentions' }),
recordedAt: fields.text({ label: 'Recorded At' }),
teaches: fields.text({ label: 'Teaches' }),
version: fields.text({ label: 'Version' }),
workTranslation: fields.text({ label: 'Work Translation' }),
},
}),
},
});