-
Notifications
You must be signed in to change notification settings - Fork 27
/
sanity.config.ts
70 lines (67 loc) · 2.22 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
import {
documentI18n,
getFilteredDocumentTypeListItems,
} from '@sanity/document-internationalization'
import { visionTool } from '@sanity/vision'
import { i18n } from '~/i18n'
import { jobSchema } from '~/schemas/documents/job'
import { memberSchema } from '~/schemas/documents/member'
import { pageSchema } from '~/schemas/documents/page'
import { portfolioSchema } from '~/schemas/documents/portfolio'
import { squadSchema } from '~/schemas/documents/squad'
import { blockContentSchema } from '~/schemas/objects/blockContent'
import { localeStringSchema } from '~/schemas/objects/localeString'
import { apiVersion, dataset, previewSecretId, projectId } from 'lib/sanity.api'
import { previewDocumentNode } from 'plugins/previewPane'
import { defineConfig } from 'sanity'
import { deskTool } from 'sanity/desk'
const title = process.env.NEXT_PUBLIC_SANITY_PROJECT_TITLE || 'Zolplay Website'
export default defineConfig({
basePath: '/studio',
projectId,
dataset,
title,
schema: {
types: [
localeStringSchema,
blockContentSchema,
memberSchema,
squadSchema,
jobSchema,
portfolioSchema,
pageSchema,
],
},
plugins: [
documentI18n({
base: i18n.defaultId,
languages: i18n.languages,
}),
deskTool({
structure: (S, { schema }) => {
const items = getFilteredDocumentTypeListItems({
S,
schema,
config: {
base: i18n.defaultId,
languages: i18n.languages,
},
}).map((item) => {
// pluralize the title
item.title = item.title + 's'
return item
})
return S.list()
.title('Content')
.items([...items])
},
// `defaultDocumentNode` is responsible for adding a “Preview” tab to the document pane
defaultDocumentNode: previewDocumentNode({ apiVersion, previewSecretId }),
}),
// Configures the global "new document" button, and document actions, to suit the Settings document singleton
// settingsPlugin({ type: settingsType.name }),
// Vision lets you query your content with GROQ in the studio
// https://www.sanity.io/docs/the-vision-plugin
visionTool({ defaultApiVersion: apiVersion }),
],
})