forked from hocha113/cwrwiki
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkeystatic.config.ts
More file actions
274 lines (258 loc) · 8.41 KB
/
keystatic.config.ts
File metadata and controls
274 lines (258 loc) · 8.41 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
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
import { config, fields, collection } from '@keystatic/core';
export default config({
storage: {
kind: 'local',
},
collections: {
items: collection({
label: '物品图鉴',
slugField: 'title',
path: 'src/content/docs/cn/items/*',
format: { contentField: 'content' },
schema: {
title: fields.slug({ name: { label: '物品名称' } }),
description: fields.text({
label: '物品描述',
description: '简短的物品描述,用于SEO和预览',
}),
itemIcon: fields.image({
label: '物品图标',
directory: 'public/items',
publicPath: '/items/',
description: '上传物品图标(推荐 48x48 或更大的PNG图片)',
}),
rarity: fields.select({
label: '稀有度',
options: [
{ label: '白色', value: 'common' },
{ label: '绿色', value: 'uncommon' },
{ label: '蓝色', value: 'rare' },
{ label: '浅紫色', value: 'epic' },
{ label: '橙色', value: 'legendary' },
{ label: '红色', value: 'mythic' },
],
defaultValue: 'common',
}),
itemType: fields.text({
label: '物品类型',
description: '例如:近战武器、远程武器、魔法武器、配饰等',
defaultValue: '近战武器',
}),
// 基础属性
damage: fields.integer({
label: '伤害',
description: '武器的基础伤害值',
validation: { min: 0 },
}),
knockback: fields.number({
label: '击退',
description: '击退力度(0-10)',
validation: { min: 0, max: 10 },
}),
criticalChance: fields.integer({
label: '暴击率 (%)',
description: '暴击几率百分比',
defaultValue: 4,
validation: { min: 0, max: 100 },
}),
useTime: fields.integer({
label: '使用时间',
description: '使用速度(数值越小越快)',
validation: { min: 1 },
}),
useTimeDesc: fields.text({
label: '使用速度描述',
description: '例如:快速、极快、缓慢等',
defaultValue: '快速',
}),
sellPrice: fields.text({
label: '卖出价格',
description: '例如:10 金币',
defaultValue: '1 金币',
}),
// 特殊效果
specialEffects: fields.array(
fields.text({ label: '效果' }),
{
label: '特殊效果',
description: '物品的特殊效果列表',
itemLabel: (props) => props.value || '新效果',
}
),
// 物品描述
quote: fields.text({
label: '引用语',
description: '物品的引用语(显示在描述顶部)',
multiline: false,
}),
content: fields.document({
label: '详细描述',
description: '物品的详细背景故事和描述',
formatting: true,
dividers: true,
links: true,
images: {
directory: 'public/items',
publicPath: '/items/',
},
}),
// 获取方式
craftingStation: fields.text({
label: '合成工作台',
description: '用于合成此物品的工作台',
}),
craftingMaterials: fields.array(
fields.object({
material: fields.text({ label: '材料名称' }),
amount: fields.integer({ label: '数量', defaultValue: 1 }),
}),
{
label: '合成材料',
itemLabel: (props) => props.fields.material.value || '新材料',
}
),
craftingConditions: fields.array(
fields.text({ label: '条件' }),
{
label: '合成前置条件',
itemLabel: (props) => props.value || '新条件',
}
),
// Boss掉落
bossDrops: fields.array(
fields.object({
bossName: fields.text({ label: 'Boss名称' }),
dropRate: fields.text({ label: '掉落率', defaultValue: '10%' }),
condition: fields.text({ label: '特殊条件' }),
}),
{
label: 'Boss 掉落',
itemLabel: (props) => props.fields.bossName.value || '新Boss',
}
),
// 商店购买
shopInfo: fields.text({
label: '商店购买信息',
multiline: true,
description: '商店购买的详细信息,留空表示无法购买',
}),
// 使用技巧
combatStrategies: fields.array(
fields.text({ label: '策略', multiline: true }),
{
label: '战斗策略',
itemLabel: (props) => props.value?.substring(0, 30) || '新策略',
}
),
// 配装推荐
recommendedArmor: fields.text({
label: '推荐护甲',
multiline: true,
}),
recommendedAccessories: fields.text({
label: '推荐饰品',
multiline: true,
}),
recommendedPotions: fields.text({
label: '推荐药水',
multiline: true,
}),
// 升级路线
upgradePath: fields.text({
label: '升级路线',
description: '例如:铁剑 → 烈焰剑 → 此物品',
multiline: true,
}),
// 冷知识
trivia: fields.array(
fields.text({ label: '冷知识', multiline: true }),
{
label: '冷知识',
itemLabel: (props) => props.value?.substring(0, 30) || '新冷知识',
}
),
// 相关物品
relatedItems: fields.array(
fields.object({
name: fields.text({ label: '物品名称' }),
description: fields.text({ label: '描述', multiline: true }),
}),
{
label: '相关物品',
itemLabel: (props) => props.fields.name.value || '新物品',
}
),
},
}),
mechanics: collection({
label: '全新机制',
slugField: 'title',
path: 'src/content/docs/cn/mechanics/*',
format: { contentField: 'content' },
schema: {
title: fields.slug({ name: { label: '机制名称' } }),
description: fields.text({
label: '机制简述',
description: '用于卡片展示的简短描述',
multiline: true,
}),
mechanicCover: fields.image({
label: '封面图片',
directory: 'src/content/docs/cn/mechanics',
publicPath: './',
description: '机制的展示图片',
}),
mechanicType: fields.text({
label: '机制类型',
description: '例如:天气系统、战斗机制、世界生成等',
defaultValue: '系统机制',
}),
content: fields.document({
label: '详细内容',
formatting: true,
dividers: true,
links: true,
images: {
directory: 'src/content/docs/cn/mechanics',
publicPath: './',
},
}),
},
}),
references: collection({
label: '综合维基',
slugField: 'title',
path: 'src/content/docs/cn/reference/*',
format: { contentField: 'content' },
schema: {
title: fields.slug({ name: { label: '文章标题' } }),
description: fields.text({
label: '文章摘要',
description: '用于卡片展示的简短摘要',
multiline: true,
}),
referenceCover: fields.image({
label: '封面图片',
directory: 'src/content/docs/cn/reference',
publicPath: './',
description: '文章的展示图片',
}),
referenceCategory: fields.text({
label: '分类',
description: '例如:游玩攻略、Boss攻略、机制解析等',
defaultValue: '综合指南',
}),
content: fields.document({
label: '详细内容',
formatting: true,
dividers: true,
links: true,
images: {
directory: 'src/content/docs/cn/reference',
publicPath: './',
},
}),
},
}),
},
});