-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathstackbit.config.ts
More file actions
42 lines (38 loc) · 1.1 KB
/
stackbit.config.ts
File metadata and controls
42 lines (38 loc) · 1.1 KB
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
import { SanityContentSource } from '@stackbit/cms-sanity';
import { defineStackbitConfig } from '@stackbit/types';
import * as path from 'path';
export default defineStackbitConfig({
stackbitVersion: '0.5.0',
ssgName: 'nextjs',
nodeVersion: '16',
buildCommand: 'npm run build',
publishDir: 'out',
import: {
type: 'sanity',
contentFile: 'sanity-export/export.tar.gz',
sanityStudioPath: 'studio',
deployStudio: true,
deployGraphql: false,
projectIdEnvVar: 'SANITY_PROJECT_ID',
datasetEnvVar: 'SANITY_DATASET',
tokenEnvVar: 'SANITY_TOKEN',
},
mapModels: ({ models }) => {
return models.map((model) => {
if (['page', 'landing'].includes(model.name)) {
return { ...model, type: 'page', urlPath: '/{slug}' };
}
return model;
});
},
contentSources: [
new SanityContentSource({
rootPath: __dirname,
studioPath: path.join(__dirname, 'studio'),
studioUrl: '',
projectId: process.env.SANITY_PROJECT_ID!,
token: process.env.SANITY_TOKEN!,
dataset: process.env.SANITY_DATASET || 'production',
}),
],
});