-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathalinea.config.tsx
63 lines (62 loc) · 1.78 KB
/
alinea.config.tsx
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
import {createCloudBackend} from '@alinea/cloud'
import {MediaSchema} from '@alinea/dashboard/schema/MediaSchema'
import {IcRoundInsertDriveFile} from '@alinea/ui/icons/IcRoundInsertDriveFile'
import {IcRoundPermMedia} from '@alinea/ui/icons/IcRoundPermMedia'
import alinea, {BrowserPreview} from 'alinea'
import {SectionsSchema} from './src/sections/Sections.schema'
export const config = alinea.createConfig({
workspaces: {
main: alinea.workspace('Example', {
source: './content',
mediaDir: './public',
schema: alinea.schema({
...MediaSchema,
Page: alinea.type('Page', {
title: alinea.text('Title'),
path: alinea.path('Path'),
sections: SectionsSchema
}),
Blog: alinea
.type('Blog', {
title: alinea.text('Title'),
path: alinea.path('Path'),
sections: SectionsSchema
})
.configure({isContainer: true, contains: ['Article']}),
Article: alinea.type('Article', {
title: alinea.text('Title'),
path: alinea.path('Path'),
date: alinea.text('Date'),
tag: alinea.select('Tag', {
World: 'World',
Analysis: 'Analysis',
Lifestyle: 'Lifestyle',
Wedding: 'Wedding'
}),
sections: SectionsSchema
})
}),
roots: {
data: alinea.root('Example project', {
icon: IcRoundInsertDriveFile,
contains: ['Page']
}),
media: alinea.root('Media', {
icon: IcRoundPermMedia,
contains: ['MediaLibrary']
})
},
preview({previewToken}) {
const base =
location.host === 'localhost:4500' ? 'http://localhost:3000' : ''
return <BrowserPreview url={`${base}/api/preview?${previewToken}`} />
}
})
},
backend: createCloudBackend() as any,
dashboard: {
dashboardUrl: '/admin.html',
handlerUrl: '/api/cms',
staticFile: './public/admin.html'
}
})