forked from nuotsu/sanitypress
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsanity.config.ts
48 lines (41 loc) · 1.1 KB
/
sanity.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import { defineConfig } from 'sanity'
import { structureTool } from 'sanity/structure'
import defaultDocumentNode from './src/defaultDocumentNode'
import { projectId } from './src/env'
import structure from './src/structure'
import {
dashboardTool,
projectInfoWidget,
projectUsersWidget,
} from '@sanity/dashboard'
import { visionTool } from '@sanity/vision'
import { schemaTypes } from './schemas'
const singletonTypes = ['site']
export default defineConfig({
name: 'default',
title: 'Next.js + Sanity.io Starter Template',
projectId,
dataset: 'production',
plugins: [
structureTool({ defaultDocumentNode, structure }),
dashboardTool({ widgets: [projectInfoWidget(), projectUsersWidget()] }),
visionTool(),
],
schema: {
types: schemaTypes,
templates: (templates) =>
templates.filter(
({ schemaType }) => !singletonTypes.includes(schemaType),
),
},
document: {
actions: (input, { schemaType }) =>
singletonTypes.includes(schemaType)
? input.filter(
({ action }) =>
action &&
['publish', 'discardChanges', 'restore'].includes(action),
)
: input,
},
})