Integrate Keystatic to edit twenty.com content (#10709)
This PR introduces Keystatic to let us edit twenty.com's content with a CMS. For now, we'll focus on creating release notes through Keystatic as it uses quite simple Markdown. Other types of content will need some refactoring to work with Keystatic. https://github.com/user-attachments/assets/e9f85bbf-daff-4b41-bc97-d1baf63758b2 --------- Co-authored-by: Félix Malfait <felix@twenty.com>
This commit is contained in:
committed by
GitHub
parent
6b4d3ed025
commit
2c465bd42e
55
packages/twenty-website/keystatic.config.ts
Normal file
55
packages/twenty-website/keystatic.config.ts
Normal file
@ -0,0 +1,55 @@
|
||||
import { collection, config, fields } from '@keystatic/core';
|
||||
import { wrapper } from '@keystatic/core/content-components';
|
||||
|
||||
export default config({
|
||||
storage: {
|
||||
kind:
|
||||
process.env.KEYSTATIC_STORAGE_KIND === ''
|
||||
? 'local'
|
||||
: ((process.env.KEYSTATIC_STORAGE_KIND || 'local') as
|
||||
| 'local'
|
||||
| 'github'
|
||||
| 'cloud'),
|
||||
repo: {
|
||||
owner: 'twentyhq',
|
||||
name: 'twenty',
|
||||
},
|
||||
},
|
||||
collections: {
|
||||
developers: collection({
|
||||
label: 'Technical documentation',
|
||||
slugField: 'title',
|
||||
path: 'src/content/developers/**',
|
||||
format: { contentField: 'content' },
|
||||
schema: {
|
||||
title: fields.slug({ name: { label: 'Title' } }),
|
||||
icon: fields.text({ label: 'Icon' }),
|
||||
image: fields.text({ label: 'Image' }),
|
||||
info: fields.text({ label: 'Info' }),
|
||||
content: fields.mdx({
|
||||
label: 'Content',
|
||||
components: {
|
||||
ArticleEditContent: wrapper({
|
||||
label: 'ArticleEditContent',
|
||||
schema: {},
|
||||
}),
|
||||
},
|
||||
}),
|
||||
},
|
||||
}),
|
||||
releases: collection({
|
||||
label: 'Releases',
|
||||
slugField: 'release',
|
||||
path: 'src/content/releases/*',
|
||||
format: { contentField: 'content' },
|
||||
schema: {
|
||||
release: fields.slug({ name: { label: 'Release' } }),
|
||||
// TODO: Define the date with a normalized format
|
||||
Date: fields.text({ label: 'Date' }),
|
||||
content: fields.mdx({
|
||||
label: 'Content',
|
||||
}),
|
||||
},
|
||||
}),
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user