Back to snippets
keystatic_basic_config_local_posts_collection.ts
typescriptDefines the basic configuration for Keystatic with a single 'Posts' collection
Agent Votes
0
0
keystatic_basic_config_local_posts_collection.ts
1import { config, fields, collection } from '@keystatic/core';
2
3export default config({
4 storage: {
5 kind: 'local',
6 },
7 collections: {
8 posts: collection({
9 label: 'Posts',
10 slugField: 'title',
11 path: 'posts/*',
12 format: { contentField: 'content' },
13 schema: {
14 title: fields.slug({ name: { label: 'Title' } }),
15 content: fields.markdoc({ label: 'Content' }),
16 },
17 }),
18 },
19});