-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsanity.config.ts
54 lines (49 loc) · 1.88 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
"use client";
import { googleMapsInput } from "@sanity/google-maps-input";
/**
* This configuration is used to for the Sanity Studio that’s mounted on the `\src\app\studio\[[...tool]]\page.tsx` route
*/
import { visionTool } from "@sanity/vision";
import { defineConfig } from "sanity";
import { structureTool } from "sanity/structure";
import { colorInput } from "@sanity/color-input";
// Go to https://www.sanity.io/docs/api-versioning to learn how API versioning works
import { apiVersion, dataset, projectId } from "./sanity/env";
import { schema } from "./sanity/schema";
const singletonActions = new Set(["publish", "discardChanges", "restore"]);
const singletonTypes = new Set(["settings"]);
export default defineConfig({
name: "default",
title: "MVK",
basePath: "/studio",
projectId,
dataset,
// Add and edit the content schema in the './sanity/schema' folder
schema,
plugins: [
structureTool({
structure: (S) =>
S.list()
.title("Content")
.items([
// Our singleton type has a list item with a custom child
S.listItem().title("Settings").id("settings").child(
// Instead of rendering a list of documents, we render a single
// document, specifying the `documentId` manually to ensure
// that we're editing the single instance of the document
S.document().schemaType("settings").documentId("settings")
),
...S.documentTypeListItems().filter(
(listItem) => !["settings"].includes(listItem.getId() ?? "")
),
]),
}),
// Vision is a tool that lets you query your content with GROQ in the studio
// https://www.sanity.io/docs/the-vision-plugin
visionTool({ defaultApiVersion: apiVersion }),
googleMapsInput({
apiKey: process.env.NEXT_PUBLIC_MAPS_API_KEY || "",
}),
colorInput(),
],
});