-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontent.config.ts
More file actions
375 lines (345 loc) · 17.8 KB
/
Copy pathcontent.config.ts
File metadata and controls
375 lines (345 loc) · 17.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
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
import { defineCollection, defineContentConfig, property } from '@nuxt/content'
import { z } from 'zod'
function createLinkSchema() {
return z.object({
label: property(z.string()).editor({ label: 'Teks Tombol / Label' }),
to: property(z.string()).editor({ label: 'Tautan Tujuan (URL/Path)', tooltip: 'Contoh: /projek atau https://github.com' }),
icon: property(z.string().optional()).editor({ input: 'icon', iconLibraries: ['hugeicons', 'simple-icons'], label: 'Ikon' }),
trailing: property(z.boolean().optional()).editor({ label: 'Ikon di Kanan' }),
target: property(z.string().optional()).editor({ label: 'Target', tooltip: '_blank untuk tab baru' }),
variant: property(z.string().optional()).editor({ label: 'Varian Tombol' }),
})
}
// 🛑 Sembunyikan field bawaan Nuxt Content (seo & navigation) di Nuxt Studio UI
const hiddenSeo = property(
z.object({
title: z.string().optional(),
description: z.string().optional(),
}).optional(),
).editor({ hidden: true })
const hiddenNavigation = property(
z.union([
z.boolean(),
z.object({
title: z.string().optional(),
description: z.string().optional(),
icon: z.string().optional(),
}),
]).optional(),
).editor({ hidden: true })
// =========================================================================
// 1. SKEMA KHUSUS BERANDA (HOME) — Urut dari Atas-Kiri ke Bawah-Kanan
// =========================================================================
const homeSchema = z.object({
seo: hiddenSeo,
navigation: hiddenNavigation,
// Header / Intro Paling Atas
eyebrow: property(z.string().optional()).editor({ label: 'Teks Badge / Eyebrow', description: 'Teks kecil di atas headline' }),
headline: property(z.string().optional()).editor({ label: 'Headline Utama' }),
description: property(z.string().optional()).editor({ input: 'textarea', label: 'Deskripsi Singkat', description: 'Deskripsi intro beranda' }),
// Hero Card Utama (Kiri Atas)
hero: z.object({
status: property(z.string().optional()).editor({ label: 'Status Ketersediaan', tooltip: 'Contoh: Tersedia untuk Projek Baru' }),
kicker: property(z.string().optional()).editor({ label: 'Sub-judul Kicker' }),
headline: property(z.string().optional()).editor({ label: 'Headline Hero' }),
headline_italic: property(z.string().optional()).editor({ label: 'Kata Bercetak Miring' }),
headline_suffix: property(z.string().optional()).editor({ label: 'Akhiran Headline' }),
description: property(z.string().optional()).editor({ input: 'textarea', label: 'Deskripsi Hero Card' }),
location: property(z.string().optional()).editor({ label: 'Lokasi' }),
timezone: property(z.string().optional()).editor({ label: 'Zona Waktu' }),
links: z.array(createLinkSchema()).optional(),
}).optional(),
// Projek Terpilih (Kanan Atas)
project_section: z.object({
label: property(z.string().optional()).editor({ label: 'Label Bagian' }),
fallback_title: property(z.string().optional()).editor({ label: 'Judul Cadangan' }),
fallback_description: property(z.string().optional()).editor({ input: 'textarea', label: 'Deskripsi Cadangan' }),
all_link_text: property(z.string().optional()).editor({ label: 'Teks Link Lihat Semua' }),
}).optional(),
// Filosofi Bento (Kiri Tengah - Kartu Kuning)
philosophy: z.object({
number: property(z.string().optional()).editor({ label: 'Nomor Urut', tooltip: 'Contoh: 01' }),
quote: property(z.string().optional()).editor({ input: 'textarea', label: 'Kutipan / Filosofi' }),
quote_bold: property(z.string().optional()).editor({ label: 'Bagian Kutipan yang Tebal' }),
label: property(z.string().optional()).editor({ label: 'Label Kartu' }),
}).optional(),
// Bagian Keahlian & Tech Stack Bento
skills_section: z.object({
code_label: property(z.string().optional()).editor({ label: 'Label Skill Koding' }),
code_title: property(z.string().optional()).editor({ label: 'Judul Skill Koding' }),
code_desc: property(z.string().optional()).editor({ input: 'textarea', label: 'Deskripsi Skill Koding' }),
code_items: z.array(z.object({
name: property(z.string()).editor({ label: 'Nama Teknologi', tooltip: 'Contoh: Nuxt & Vue 3, Flutter & Dart, Python' }),
icon: property(z.string().optional()).editor({
input: 'icon',
iconLibraries: ['simple-icons', 'hugeicons', 'vscode-icons', 'lucide'],
label: 'Pilih Ikon (Iconify / Path)',
description: 'Pilih ikon dari Iconify (Simple Icons, Hugeicons, dsb) atau ketik path file SVG lokal (misal: /icons/f-nuxt.svg)',
}),
role: property(z.string().optional()).editor({ label: 'Badge Singkat', tooltip: 'Contoh: Web & SSR, Mobile App, Logika Data' }),
desc: property(z.string().optional()).editor({ input: 'textarea', label: 'Deskripsi Singkat' }),
})).optional(),
design_label: property(z.string().optional()).editor({ label: 'Label Skill Desain' }),
design_title: property(z.string().optional()).editor({ label: 'Judul Skill Desain' }),
design_desc: property(z.string().optional()).editor({ input: 'textarea', label: 'Deskripsi Skill Desain' }),
design_items: z.array(z.object({
name: property(z.string()).editor({ label: 'Nama Software / Tool', tooltip: 'Contoh: Illustrator, Photoshop, Figma' }),
icon: property(z.string().optional()).editor({
input: 'icon',
iconLibraries: ['simple-icons', 'hugeicons', 'vscode-icons', 'lucide'],
label: 'Pilih Ikon (Iconify / Path)',
description: 'Pilih ikon dari Iconify (Simple Icons, Hugeicons, dsb) atau ketik path file SVG lokal (misal: /icons/d-illustrator.svg)',
}),
role: property(z.string().optional()).editor({ label: 'Badge Singkat', tooltip: 'Contoh: Vektor, Raster, UI System' }),
desc: property(z.string().optional()).editor({ input: 'textarea', label: 'Deskripsi Singkat' }),
})).optional(),
}).optional(),
// Tulisan & Catatan Terbaru (Paling Bawah / 12 Kolom Penuh)
writing: z.object({
label: property(z.string().optional()).editor({ label: 'Label Tulisan' }),
title: property(z.string().optional()).editor({ label: 'Judul Bagian Blog' }),
all_link_text: property(z.string().optional()).editor({ label: 'Teks Link Semua Artikel' }),
}).optional(),
})
// =========================================================================
// 2. SKEMA KHUSUS TENTANG (ABOUT)
// =========================================================================
const aboutSchema = z.object({
seo: hiddenSeo,
navigation: hiddenNavigation,
section_label: property(z.string().optional()).editor({ label: 'Label Halaman' }),
headline: property(z.string().optional()).editor({ label: 'Headline Halaman' }),
lead: property(z.string().optional()).editor({ input: 'textarea', label: 'Teks Pembuka (Lead)' }),
description: property(z.string().optional()).editor({ input: 'textarea', label: 'Deskripsi Lengkap' }),
story_card: z.object({
label: property(z.string().optional()).editor({ label: 'Label Cerita' }),
title: property(z.string().optional()).editor({ label: 'Judul Cerita' }),
lead: property(z.string().optional()).editor({ input: 'textarea', label: 'Lead Cerita' }),
bio: property(z.string().optional()).editor({ input: 'textarea', label: 'Biografi Singkat' }),
link_text: property(z.string().optional()).editor({ label: 'Teks Link' }),
}).optional(),
toolkit_card: z.object({
label: property(z.string().optional()).editor({ label: 'Label Toolkit' }),
title: property(z.string().optional()).editor({ label: 'Judul Toolkit' }),
tools: z.array(z.object({
name: property(z.string()).editor({ label: 'Nama Tool/Teknologi' }),
desc: property(z.string()).editor({ label: 'Keterangan Singkat' }),
})).optional(),
}).optional(),
principles: z.array(z.object({
title: property(z.string()).editor({ label: 'Judul Prinsip' }),
description: property(z.string()).editor({ input: 'textarea', label: 'Penjelasan Prinsip' }),
})).optional(),
journey: z.object({
title: property(z.string().optional()).editor({ label: 'Judul Perjalanan' }),
description: property(z.string().optional()).editor({ input: 'textarea', label: 'Deskripsi Perjalanan' }),
}).optional(),
})
// =========================================================================
// 3. SKEMA KHUSUS KONTAK (CONTACT)
// =========================================================================
const contactSchema = z.object({
seo: hiddenSeo,
navigation: hiddenNavigation,
section_label: property(z.string().optional()).editor({ label: 'Label Halaman' }),
headline: property(z.string().optional()).editor({ label: 'Headline Kontak' }),
lead: property(z.string().optional()).editor({ input: 'textarea', label: 'Teks Pembuka (Lead)' }),
description: property(z.string().optional()).editor({ input: 'textarea', label: 'Deskripsi Kontak' }),
email_card: z.object({
label: property(z.string().optional()).editor({ label: 'Label Kartu Email' }),
email: property(z.string().optional()).editor({ label: 'Alamat Email' }),
description: property(z.string().optional()).editor({ input: 'textarea', label: 'Deskripsi Email' }),
button_text: property(z.string().optional()).editor({ label: 'Teks Tombol Email' }),
meta: property(z.string().optional()).editor({ label: 'Keterangan Tambahan' }),
}).optional(),
status_card: z.object({
label: property(z.string().optional()).editor({ label: 'Label Status' }),
title: property(z.string().optional()).editor({ label: 'Judul Status' }),
description: property(z.string().optional()).editor({ input: 'textarea', label: 'Deskripsi Status' }),
location: property(z.string().optional()).editor({ label: 'Lokasi' }),
timezone: property(z.string().optional()).editor({ label: 'Zona Waktu' }),
}).optional(),
social_card: z.object({
label: property(z.string().optional()).editor({ label: 'Label Media Sosial' }),
title: property(z.string().optional()).editor({ label: 'Judul Media Sosial' }),
description: property(z.string().optional()).editor({ input: 'textarea', label: 'Deskripsi' }),
items: z.array(z.object({
name: property(z.string()).editor({ label: 'Nama Jejaring' }),
url: property(z.string()).editor({ label: 'Tautan URL' }),
icon: property(z.string().optional()).editor({ input: 'icon', iconLibraries: ['hugeicons', 'simple-icons'], label: 'Ikon' }),
})).optional(),
}).optional(),
newsletter_card: z.object({
label: property(z.string().optional()).editor({ label: 'Label Newsletter' }),
title: property(z.string().optional()).editor({ label: 'Judul Newsletter' }),
description: property(z.string().optional()).editor({ input: 'textarea', label: 'Deskripsi Newsletter' }),
}).optional(),
})
// =========================================================================
// 4. SKEMA HEADER HALAMAN DAFTAR (Blog, Projek, Galeri)
// =========================================================================
const catalogSchema = z.object({
seo: hiddenSeo,
navigation: hiddenNavigation,
eyebrow: property(z.string().optional()).editor({ label: 'Teks Badge / Eyebrow' }),
title: property(z.string().optional()).editor({ label: 'Judul Halaman' }),
description: property(z.string().optional()).editor({ input: 'textarea', label: 'Deskripsi Halaman' }),
})
export default defineContentConfig({
collections: {
// --- 1. BERANDA (HOME) ---
home_en: defineCollection({
type: 'page',
source: 'en/0.index.yml',
schema: homeSchema,
}),
home_id: defineCollection({
type: 'page',
source: 'id/0.index.yml',
schema: homeSchema,
}),
// --- 2. TENTANG (ABOUT) ---
tentang_en: defineCollection({
type: 'page',
source: 'en/4.about.yml',
schema: aboutSchema,
}),
tentang_id: defineCollection({
type: 'page',
source: 'id/4.tentang.yml',
schema: aboutSchema,
}),
// --- 3. KONTAK (CONTACT) ---
kontak_en: defineCollection({
type: 'page',
source: 'en/5.contact.yml',
schema: contactSchema,
}),
kontak_id: defineCollection({
type: 'page',
source: 'id/5.kontak.yml',
schema: contactSchema,
}),
// --- 4. HEADER DAFTAR (Blog, Projek, Galeri) ---
pages_en: defineCollection({
type: 'page',
source: {
include: 'en/*.yml',
exclude: ['en/0.index.yml', 'en/4.about.yml', 'en/5.contact.yml'],
},
schema: catalogSchema,
}),
pages_id: defineCollection({
type: 'page',
source: {
include: 'id/*.yml',
exclude: ['id/0.index.yml', 'id/4.tentang.yml', 'id/5.kontak.yml'],
},
schema: catalogSchema,
}),
// --- 5. ARTIKEL BLOG ---
blog_en: defineCollection({
type: 'page',
source: {
include: 'en/blog/**',
prefix: '/en/blog',
},
schema: z.object({
seo: property(z.any().optional()).editor({ hidden: true }),
navigation: property(z.any().optional()).editor({ hidden: true }),
idItem: property(z.number().optional()).editor({ hidden: true }),
idBlog: property(z.number().optional()).editor({ hidden: true }),
readingTime: property(z.number().optional()).editor({ hidden: true }),
slug: property(z.string().optional()).editor({ hidden: true }),
plainText: property(z.string().optional()).editor({ hidden: true }),
category: property(z.enum(['edu', 'tech', 'art']).optional()).editor({
label: 'Kategori / Category',
tooltip: 'edu (Pendidikan / Education), tech (Teknologi / Technology), art (Seni / Art)',
}),
date: property(z.date()).editor({ label: 'Publication Date', description: 'Choose the article publication date' }),
tags: property(z.array(z.string()).default([])).editor({ label: 'Tags & Topics', description: 'Add tags for classification' }),
}),
}),
blog_id: defineCollection({
type: 'page',
source: {
include: 'id/blog/**',
prefix: '/id/blog',
},
schema: z.object({
seo: property(z.any().optional()).editor({ hidden: true }),
navigation: property(z.any().optional()).editor({ hidden: true }),
idItem: property(z.number().optional()).editor({ hidden: true }),
idBlog: property(z.number().optional()).editor({ hidden: true }),
readingTime: property(z.number().optional()).editor({ hidden: true }),
slug: property(z.string().optional()).editor({ hidden: true }),
plainText: property(z.string().optional()).editor({ hidden: true }),
category: property(z.enum(['edu', 'tech', 'art']).optional()).editor({
label: 'Kategori / Category',
tooltip: 'edu (Pendidikan / Education), tech (Teknologi / Technology), art (Seni / Art)',
}),
date: property(z.date()).editor({ label: 'Tanggal Publikasi', description: 'Pilih tanggal rilis artikel' }),
tags: property(z.array(z.string()).default([])).editor({ label: 'Tag & Topik', description: 'Daftar topik pembahasan artikel' }),
}),
}),
// --- 6. PROJEK PORTOFOLIO ---
projek_en: defineCollection({
type: 'page',
source: {
include: 'en/projects/**',
prefix: '/en/projects',
},
schema: z.object({
seo: property(z.any().optional()).editor({ hidden: true }),
navigation: property(z.any().optional()).editor({ hidden: true }),
idItem: property(z.number().optional()).editor({ hidden: true }),
idProjek: property(z.number().optional()).editor({ hidden: true }),
readingTime: property(z.number().optional()).editor({ hidden: true }),
slug: property(z.string().optional()).editor({ hidden: true }),
plainText: property(z.string().optional()).editor({ hidden: true }),
category: property(z.enum(['web', 'mobile', 'design']).optional()).editor({
label: 'Kategori / Category',
tooltip: 'web (Web App), mobile (Mobile App), design (Desain / Design)',
}),
date: property(z.date()).editor({ label: 'Release Date', description: 'Pick launch / release date' }),
tags: property(z.array(z.string()).default([])).editor({ label: 'Technologies & Tags', description: 'List of tech stack and tags' }),
image: property(z.string()).editor({ input: 'media', label: 'Primary Thumbnail', description: 'Main project cover image' }).optional(),
images: property(z.array(property(z.string()).editor({ input: 'media', label: 'Screenshot Image' }))).editor({
label: 'Gallery & Screenshots',
description: 'Screenshot images for the Bento showcase gallery',
}).default([]),
link: property(z.string().optional()).editor({ label: 'Live Demo URL', tooltip: 'URL to live website or interactive demo' }),
repo: property(z.string().optional()).editor({ label: 'GitHub Repository URL', tooltip: 'Source code repository link on GitHub' }),
}),
}),
projek_id: defineCollection({
type: 'page',
source: {
include: 'id/projek/**',
prefix: '/id/projek',
},
schema: z.object({
seo: property(z.any().optional()).editor({ hidden: true }),
navigation: property(z.any().optional()).editor({ hidden: true }),
idItem: property(z.number().optional()).editor({ hidden: true }),
idProjek: property(z.number().optional()).editor({ hidden: true }),
readingTime: property(z.number().optional()).editor({ hidden: true }),
slug: property(z.string().optional()).editor({ hidden: true }),
plainText: property(z.string().optional()).editor({ hidden: true }),
category: property(z.enum(['web', 'mobile', 'design']).optional()).editor({
label: 'Kategori / Category',
tooltip: 'web (Web App), mobile (Mobile App), design (Desain / Design)',
}),
date: property(z.date()).editor({ label: 'Tanggal Rilis', description: 'Pilih tanggal peluncuran projek' }),
tags: property(z.array(z.string()).default([])).editor({ label: 'Teknologi & Tag', description: 'Daftar teknologi yang digunakan' }),
image: property(z.string()).editor({ input: 'media', label: 'Thumbnail Utama', description: 'Gambar cover utama projek' }).optional(),
images: property(z.array(property(z.string()).editor({ input: 'media', label: 'Gambar Screenshot' }))).editor({
label: 'Galeri Tangkapan Layar',
description: 'Koleksi tangkapan layar untuk showcase Bento gallery',
}).default([]),
link: property(z.string().optional()).editor({ label: 'Tautan Live Demo (URL)', tooltip: 'URL website atau demo langsung yang bisa dikunjungi' }),
repo: property(z.string().optional()).editor({ label: 'Repository GitHub (Source Code)', tooltip: 'URL repositori source code di GitHub' }),
}),
}),
},
})