-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsanity.config.js
49 lines (46 loc) · 1.66 KB
/
sanity.config.js
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 { defineConfig } from "sanity";
import { deskTool } from "sanity/desk";
import schemas from "./sanity/schemas";
require("dotenv").config();
const singletonActions = new Set(["publish", "discardChanges", "restore"]);
const singletonTypes = new Set(["settings"]);
const config = defineConfig({
projectId: process.env.NEXT_PUBLIC_SANITY_PROJECT_ID,
dataset: process.env.NEXT_PUBLIC_SANITY_PROJECT_DATASET,
title: "portfolio",
apiVersion: "2023-11-09",
basePath: "/admin",
plugins: [
deskTool({
structure: (S) =>
S.list()
.title("Base")
.items([
// Our singleton type has a list item with a custom child
S.listItem()
.title("About")
.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("aboutPage").documentId("aboutPage")
),
S.listItem()
.title("Subtitle")
.child(
S.document().schemaType("subtitlePage").documentId("subtitlePage")
),
S.listItem()
.title("Socials")
.child(S.document().schemaType("socialsPage").documentId("socialsPage")),
S.divider(),
// Regular document types
...S.documentTypeListItems().filter(
(item) => !["aboutPage","subtitlePage","socialsPage"].includes(item.getId())
),
]),
}),
],
schema: { types: schemas },
});
export default config;