-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathsanity.config.ts
101 lines (93 loc) · 3.28 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
"use client";
/**
* This config is used to set up Sanity Studio that's mounted on the `app/(sanity)/studio/[[...tool]]/page.tsx` route
*/
import { codeInput } from '@sanity/code-input';
import { colorInput } from '@sanity/color-input';
import { dashboardTool, projectInfoWidget, projectUsersWidget } from "@sanity/dashboard";
import { visionTool } from "@sanity/vision";
import { PluginOptions, defineConfig } from "sanity";
import { unsplashImageAsset } from "sanity-plugin-asset-source-unsplash";
import { markdownSchema } from "sanity-plugin-markdown";
import { media } from 'sanity-plugin-media';
import { presentationTool } from "sanity/presentation";
import { structureTool } from "sanity/structure";
import defaultDocumentNode from '@/sanity/defaultDocumentNode';
import { apiVersion, dataset, projectId, studioUrl } from "@/sanity/lib/api";
import { locate } from "@/sanity/plugins/locate";
import { pageStructure, singletonPlugin } from "@/sanity/plugins/settings";
import author from "@/sanity/schemas/documents/author";
import post from "@/sanity/schemas/documents/post";
import product from "@/sanity/schemas/documents/product";
import settings from "@/sanity/schemas/singletons/settings";
import application from "./sanity/schemas/documents/application";
import category from "./sanity/schemas/documents/category";
import { comment } from "./sanity/schemas/documents/comment";
import submission from "./sanity/schemas/documents/submission";
import tag from "./sanity/schemas/documents/tag";
import appType from './sanity/schemas/documents/appType';
import user from './sanity/schemas/documents/user';
import group from './sanity/schemas/documents/group';
import guide from './sanity/schemas/documents/guide';
import localizedString from './sanity/schemas/singletons/localizedString';
export default defineConfig({
basePath: studioUrl,
projectId,
dataset,
schema: {
types: [
// Singletons
settings,
localizedString,
// Documents
product,
submission,
application,
user,
guide,
tag,
category,
group,
appType,
post,
author,
comment,
],
},
plugins: [
structureTool({
defaultDocumentNode,
structure: pageStructure([settings]),
}),
dashboardTool({
widgets: [
projectInfoWidget(),
projectUsersWidget(),
// sanityTutorialsWidget()
],
}),
presentationTool({
locate,
previewUrl: { previewMode: { enable: "/api/draft" } },
}),
// https://www.sanity.io/plugins/sanity-plugin-media
media(),
// https://www.sanity.io/plugins/sanity-plugin-markdown
markdownSchema(),
// Configures the global "new document" button, and document actions, to suit the Settings document singleton
singletonPlugin([settings.name]),
// Add an image asset source for Unsplash
unsplashImageAsset(),
// Sets up AI Assist with preset prompts
// https://www.sanity.io/docs/ai-assist
// assistWithPresets(),
colorInput(),
codeInput(),
// Vision lets you query your content with GROQ in the studio
// https://www.sanity.io/docs/the-vision-plugin
// process.env.NODE_ENV === "development" &&
visionTool({
defaultApiVersion: apiVersion
}),
].filter(Boolean) as PluginOptions[],
});