forked from dagstuan/bake
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sanity.config.ts
58 lines (53 loc) · 1.79 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
"use client";
/**
* This configuration is used to for the Sanity Studio that’s mounted on the `/app/studio/[[...tool]]/page.tsx` route
*/
import { visionTool } from "@sanity/vision";
import { defineConfig } from "sanity";
import { structureTool } from "sanity/structure";
import { presentationTool } from "sanity/presentation";
import { media } from "sanity-plugin-media";
// Go to https://www.sanity.io/docs/api-versioning to learn how API versioning works
import {
apiVersion,
dataset,
draftModeRoute,
projectId,
} from "./src/sanity/env";
import { schema } from "./src/sanity/schemaTypes";
import { resolveStructure } from "./src/sanity/structure/structure";
import { resolve } from "@/sanity/presentation/resolve";
import { resolvePagePreviewUrl } from "@/sanity/lib/resolveProductionUrl";
import { defaultDocumentNode } from "@/sanity/structure/defaultDocumentNode";
import { singletonPlugin } from "@/sanity/plugins/singletonPlugin";
import { homeType } from "@/sanity/schemaTypes/singletons/homeType";
import { aboutType } from "@/sanity/schemaTypes/singletons/aboutType";
import { recipeIngredientType } from "@/sanity/schemaTypes/recipe/recipeIngredientType";
const singletonTypes = [homeType, aboutType, recipeIngredientType];
export default defineConfig({
title: "Bakdel studio",
basePath: "/studio",
projectId,
dataset,
schema,
plugins: [
structureTool({
structure: resolveStructure(singletonTypes),
defaultDocumentNode,
}),
presentationTool({
resolve,
previewUrl: {
previewMode: {
enable: draftModeRoute,
},
},
}),
media(),
singletonPlugin({ types: singletonTypes.map((t) => t.name) }),
visionTool({ defaultApiVersion: apiVersion }),
],
document: {
productionUrl: resolvePagePreviewUrl,
},
});