forked from SimeonGriggs/sanity-react-router-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sanity.config.ts
49 lines (47 loc) · 1.26 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
import {visionTool} from '@sanity/vision'
import {defineConfig} from 'sanity'
import {defineLocations, presentationTool} from 'sanity/presentation'
import {structureTool} from 'sanity/structure'
import {STUDIO_BASEPATH} from '~/sanity/constants'
import {projectDetails} from '~/sanity/projectDetails'
import schema from '~/sanity/schemaTypes'
import {defaultDocumentNode, structure} from '~/sanity/structure'
export default defineConfig({
...projectDetails(),
name: 'sanity-remix',
title: 'Sanity Remix',
plugins: [
structureTool({structure, defaultDocumentNode}),
presentationTool({
previewUrl: {
previewMode: {
enable: '/resource/preview',
},
},
resolve: {
locations: {
record: defineLocations({
select: {
title: 'title',
slug: 'slug.current',
},
resolve: (doc) => ({
locations: [
{
title: doc?.title || 'Untitled',
href: `/records/${doc?.slug}`,
},
{title: 'Home', href: `/`},
],
}),
}),
},
},
}),
visionTool(),
],
basePath: STUDIO_BASEPATH,
schema: {
types: schema,
},
})