2023-04-09 18:36:30 +02:00
|
|
|
import {defineConfig} from 'sanity'
|
|
|
|
import {deskTool} from 'sanity/desk'
|
2023-04-11 16:51:02 +02:00
|
|
|
import {media} from 'sanity-plugin-media'
|
2023-04-09 18:36:30 +02:00
|
|
|
import {visionTool} from '@sanity/vision'
|
|
|
|
import {schemaTypes} from './schemas'
|
2023-04-09 20:37:04 +02:00
|
|
|
import {blogPostPublishAction} from './documentActions/blogPostPublishAction'
|
2023-04-09 18:36:30 +02:00
|
|
|
|
|
|
|
export default defineConfig({
|
2023-04-09 20:37:04 +02:00
|
|
|
name: 'personal-webiste',
|
|
|
|
title: 'Personal website',
|
2023-04-09 18:36:30 +02:00
|
|
|
|
|
|
|
projectId: 'tzamgyrm',
|
|
|
|
dataset: 'production',
|
|
|
|
|
2023-04-11 16:51:02 +02:00
|
|
|
plugins: [deskTool(), visionTool(), media()],
|
2023-04-09 18:36:30 +02:00
|
|
|
|
|
|
|
schema: {
|
|
|
|
types: schemaTypes,
|
|
|
|
},
|
2023-04-09 20:37:04 +02:00
|
|
|
|
|
|
|
document: {
|
|
|
|
// @ts-expect-error
|
|
|
|
actions: (originalActions) =>
|
|
|
|
originalActions.map((originalAction) =>
|
|
|
|
originalAction.action === 'publish' ? blogPostPublishAction(originalAction) : originalAction
|
|
|
|
),
|
|
|
|
},
|
2023-04-09 18:36:30 +02:00
|
|
|
})
|