personal-website/studio/sanity.config.ts
Filipe Medeiros bfd7276e37
fix: some fixes and improvements in the studio
Signed-off-by: Filipe Medeiros <hello@filipesm.eu>
2023-12-03 12:26:10 +01:00

55 lines
1.3 KiB
TypeScript

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 customPublishAction 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' ? customPublishAction(originalAction) : originalAction
),
},
})