import {defineConfig} from 'sanity' import {deskTool} from 'sanity/desk' import {media} from 'sanity-plugin-media' import {visionTool} from '@sanity/vision' import {schemaTypes} from './schemas' import {blogPostPublishAction} from './documentActions/blogPostPublishAction' import {unsplashImageAsset} from 'sanity-plugin-asset-source-unsplash' import {getDocumentList, withDocumentI18nPlugin} from '@sanity/document-internationalization' const languages = [ {id: 'pt_PT', title: 'Português'}, {id: 'en_EN', title: 'English'}, ] export default defineConfig({ name: 'personal-webiste', title: 'Personal website', projectId: 'tzamgyrm', dataset: 'production', plugins: withDocumentI18nPlugin( [ deskTool({ structure: (S, {schema}) => getDocumentList({ S, schema, config: { languages, }, }), }), visionTool(), media(), unsplashImageAsset(), ], { includeDeskTool: false, languages, } ), schema: { types: schemaTypes, }, document: { actions: (originalActions) => originalActions.map((originalAction) => originalAction.action === 'publish' ? blogPostPublishAction(originalAction) : originalAction ), }, })