From 713141279b9bf47fcf92bab26c3e57ec03bbb61f Mon Sep 17 00:00:00 2001 From: Korbs Date: Fri, 7 Jun 2024 03:16:30 -0400 Subject: [PATCH] Add Keystatic config --- keystatic.config.ts | 48 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 keystatic.config.ts diff --git a/keystatic.config.ts b/keystatic.config.ts new file mode 100644 index 0000000..8615383 --- /dev/null +++ b/keystatic.config.ts @@ -0,0 +1,48 @@ +// Environment Variables +const CMS_DASHBOARD_LOGO_DARK = import.meta.env.CMS_DASHBOARD_LOGO_DARK; +const CMS_DASHBOARD_LOGO_LIGHT = import.meta.env.CMS_DASHBOARD_LOGO_LIGHT; + +// Components +import { Link } from '@iconoir/vue'; +import { config, fields, collection } from '@keystatic/core'; +import { block, inline, wrapper } from '@keystatic/core/content-components' + +export default config({ + // https://keystatic.com/docs/user-interface + ui: { + brand: { + name: 'Document CMS', + }, + mark: ({ colorScheme }) => { + let path = colorScheme === 'dark' + ? CMS_DASHBOARD_LOGO_DARK // For Dark Theme + : CMS_DASHBOARD_LOGO_LIGHT; // For Light Theme + }, + navigation: { + 'Documents': ['docs'] + }, + }, + // https://keystatic.com/docs/local-mode + storage: { + kind: 'local', + }, + // https://keystatic.com/docs/collections + collections: { + docs: collection({ + label: 'Documents', + slugField: 'title', + path: 'src/content/docs/*', + format: { contentField: 'content' }, + entryLayout: 'content', + schema: { + title: fields.slug({ name: { label: 'Title' } }), + content: fields.mdx({ + label: 'Content', + formatting: true, + dividers: true, + links: true, + }), + }, + }), + }, +}); \ No newline at end of file