Files
johannes.gasser 92a80e8759
Build and Deploy / build-and-deploy (push) Successful in 6m50s
added image support
2026-05-18 07:01:11 +02:00

46 lines
1.3 KiB
TypeScript

import { defineConfig } from 'sanity'
import { structureTool } from 'sanity/structure'
import { visionTool } from '@sanity/vision'
import { schemaTypes } from './src/sanity/schemas'
export default defineConfig({
projectId: import.meta.env.PUBLIC_SANITY_PROJECT_ID,
dataset: import.meta.env.PUBLIC_SANITY_DATASET ?? 'production',
document: {
// Filter document actions
actions: (prev, context) => {
// For singleton documents like site settings
if (context.schemaType === 'theaterHomepage') {
// Only allow publish action (equivalent to ["update", "publish"])
return prev.filter(({action}) => action === 'publish')
}
return prev
},
// Prevent creating new documents of this type
newDocumentOptions: (prev, context) => {
return prev.filter(
(template) => template.templateId !== 'siteSettings'
)
}
},
plugins: [
structureTool({
structure: (S) =>
S.list()
.title('Content')
.items([
S.listItem()
.title('Theater Homepage')
.child(
S.document()
.schemaType('theaterHomepage')
.documentId('theaterHomepage')
),
]),
}),
visionTool(),
],
schema: { types: schemaTypes },
})