forked from markhorn-dev/astro-nano
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkeystatic.config.ts
58 lines (57 loc) · 1.88 KB
/
keystatic.config.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
// keystatic.config.ts
import { config, fields, collection } from "@keystatic/core";
export default config({
storage: {
kind: "local",
},
collections: {
blog_en: collection({
label: "Blog Posts (EN)",
slugField: "title", // Define o título como slug
entryLayout: "content",
path: "src/content/blog/en/*/index", // Cria uma pasta com o nome do slug
format: {
contentField: "content", // Combina conteúdo e metadados em um arquivo `index.md`
},
schema: {
title: fields.slug({ name: { label: "Title" } }),
description: fields.text({ label: "Description" }),
date: fields.date({ label: "Date" }),
lang: fields.select({
label: "Language",
options: [{ label: "English", value: "en" }],
defaultValue: "en",
}),
draft: fields.checkbox({
label: "Draft",
description: "Check will not publish the content",
}),
content: fields.mdx({ label: "Content", extension: "mdx" }), // Para conteúdo Markdown
},
}),
blog_pt: collection({
label: "Blog Posts (PT)",
slugField: "title",
entryLayout: "content",
path: "src/content/blog/pt/*/index", // Pasta baseada no slug para posts em português
format: {
contentField: "content",
},
schema: {
title: fields.slug({ name: { label: "Título" } }),
description: fields.text({ label: "Descrição" }),
date: fields.date({ label: "Data" }),
lang: fields.select({
label: "Língua",
options: [{ label: "Portuguese", value: "pt" }],
defaultValue: "pt",
}),
draft: fields.checkbox({
label: "Rascunho",
description: "Marque para não publicar o conteúdo",
}),
content: fields.mdx({ label: "Conteúdo", extension: "mdx" }),
},
}),
},
});