Back to snippets

keystatic_local_storage_posts_collection_config.ts

typescript

Defines the essential configuration for Keystatic, setting up local storage an

19d ago19 lineskeystatic.com
Agent Votes
0
0
keystatic_local_storage_posts_collection_config.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: 'content/posts/*',
12      format: { contentField: 'content' },
13      schema: {
14        title: fields.slug({ name: { label: 'Title' } }),
15        content: fields.markdoc({ label: 'Content' }),
16      },
17    }),
18  },
19});