-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathkeystatic.config.ts
More file actions
128 lines (121 loc) · 3.66 KB
/
Copy pathkeystatic.config.ts
File metadata and controls
128 lines (121 loc) · 3.66 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
// Defines the CMS schema
import { config, fields, collection, singleton } from '@keystatic/core';
export default config({
storage: process.env.NODE_ENV === 'production'
? {
kind: 'cloud',
branchPrefix: 'keystatic/',
}
: {
kind: 'local',
},
cloud: {
project: 'ramper/ramper-web',
},
// Singletons: one-off data entries for the site
singletons: {
about: singleton({
label: 'About Section',
path: 'src/content/about/index',
format: { data: 'json', contentField: 'bio' },
schema: {
bio: fields.markdoc({
label: 'Band Biography',
description: 'The main "About Us" text.',
options: {
image: {
directory: 'public/images/about',
publicPath: '/images/about/'
}
}
}),
},
}),
},
// Collections: repeating content like news posts or releases
collections: {
posts: collection({
label: 'News / Posts',
slugField: 'title',
path: 'src/content/posts/*',
format: { contentField: 'content' },
schema: {
title: fields.slug({ name: { label: 'Title' } }),
date: fields.date({
label: 'Publish Date',
validation: { isRequired: true }
}),
summary: fields.text({
label: 'Summary',
description: 'A short teaser description.',
multiline: true
}),
content: fields.markdoc({
label: 'Post Content',
options: {
image: {
directory: 'public/images/posts',
publicPath: '/images/posts/'
}
}
}),
},
}),
releases: collection({
label: 'Published Material (Releases)',
slugField: 'title',
path: 'src/content/releases/*',
format: { contentField: 'content' },
schema: {
title: fields.slug({ name: { label: 'Album/Release Title' } }),
releaseDate: fields.date({ label: 'Release Date' }),
type: fields.select({
label: 'Release Type',
options: [
{ label: 'Album', value: 'album' },
{ label: 'EP', value: 'ep' },
{ label: 'Single', value: 'single' },
{ label: 'Live', value: 'live' },
{ label: 'Demo', value: 'demo' },
{ label: 'Session', value: 'session' },
],
defaultValue: 'album'
}),
coverImage: fields.image({
label: 'Cover Image',
description: 'Cover art for the release',
directory: 'public/images/covers',
publicPath: '/images/covers/',
}),
bandcampUrl: fields.url({ label: 'Bandcamp URL' }),
spotifyUrl: fields.url({ label: 'Spotify URL' }),
tidalUrl: fields.url({ label: 'Tidal URL' }),
qobuzUrl: fields.url({ label: 'Qobuz URL' }),
appleMusicUrl: fields.url({ label: 'Apple Music URL' }),
storeUrl: fields.url({
label: 'Store URL',
description: 'Link to buy physical copies (e.g., Humo store)'
}),
tracks: fields.array(
fields.object({
title: fields.text({ label: 'Track Title' }),
lyrics: fields.text({ label: 'Lyrics', multiline: true }),
}),
{
label: 'Tracklist',
itemLabel: props => props.fields.title.value || 'New Track'
}
),
content: fields.markdoc({
label: 'Description / Credits',
options: {
image: {
directory: 'public/images/releases',
publicPath: '/images/releases/'
}
}
}),
},
}),
},
});