Project Config
The project config affects all configurable settings of a Livingdocs project, e.g. the content types or the design. There can be several project configs within a Livingdocs installation, one for each project.
The project config has wide UI support. Basically the whole section "Project Setup" in the Livingdocs Main Navigation allows setting parts of the Project config via UI options. The parts that have UI support are marked in the documentation.
The project config is a huge JSON file with subproperties for things like content types. Below is a simple example:
1
{
2
v: 2,
3
​
4
settings: {
5
// If a channel has the channel `name` 'web' the channel configuration with
6
// the `handle` 'web' will be used.
7
handle: 'web',
8
editMode: 'default',
9
​
10
// Multi-language
11
// Important: Make sure to use ISO-639-1 compliant locale codes
12
​
13
// defines the languages that a user can select for a document
14
availableLanguages: [
15
{
16
'name': 'English',
17
'value': 'en-US'
18
}, {
19
'name': 'German',
20
'value': 'de-DE'
21
}
22
],
23
// used to create new documents
24
defaultLanguage: {
25
name: 'English',
26
value: 'en-US'
27
},
28
​
29
// setup the push notification feature if applicable
30
// for this to work you also must:
31
// 1. configure firebase in the server-wide `pushNotifications` configuration
32
// 2. have a metadata field with the (exact) name `pushNotifications`
33
// IMPORTANT: value can not contain more than three comma separated entries
34
// see firebase conditions for more details.
35
pushNotifications: {
36
topics: [{
37
handle: 'breaking-news',
38
label: 'Breaking News',
39
value: 'ios_de_breakingnews, android_de_breakingnews'
40
}, {
41
handle: 'sport',
42
label: 'Sport',
43
value: 'ios_de_sports, android_de_sports'
44
}]
45
}
46
​
47
// Copy Configuration
48
copy: [{
49
source: {
50
channelHandle: 'web',
51
contentType: 'gallery'
52
},
53
target: [{
54
channelHandle: 'web',
55
contentType: 'gallery',
56
options: {
57
copyUnknownComponents: false
58
},
59
metadata: {
60
map: [
61
{from: 'title', to: 'title'},
62
'tasks',
63
{from: 'author', to: 'description'}
64
]
65
},
66
allowTransform: true
67
}]
68
}],
69
​
70
// This setting can be overwritten in the `contentType` config
71
imageSourcePolicy: [{
72
provider: 'upload',
73
enabled: true
74
}, {
75
provider: 'hugo',
76
enabled: false
77
}, {
78
provider: 'url',
79
enabled: true,
80
hosts: ['//pixabay.com']
81
}],
82
​
83
// includeServices (added in release-2020-05)
84
// using this config, you can declaratively define include services
85
includeServices: [
86
{
87
handle: 'my-service',
88
rendering: {
89
type: 'remote',
90
url: 'http://example.com',
91
timeout: 3000
92
},
93
config: {
94
foo: 'this config is sent to the service'
95
},
96
// paramsSchema is used to render a form for datainput when a component
97
// using this service on an include directive
98
paramsSchema: [
99
{
100
type: 'li-text', // li-text is the only supported type in release-2020-05
101
handle: 'myText'
102
}
103
],
104
defaultParams: {
105
myText: 'A default value for the myText property'
106
}
107
}
108
],
109
​
110
// Integrations (added in release-2020-04)
111
integrations: {
112
// Comyan (added in release-2020-04)
113
comyan: {
114
enabled: true,
115
buttonLabel: 'open comyan'
116
mediaSystem: {
117
credentials: {
118
username: 'user',
119
password: '****'
120
},
121
baseUrl: 'https://example.com/MediaSystem',
122
}
123
}
124
}
125
​
126
// Webhooks (added in release-2020-05)
127
webhooks: {
128
enabled: true
129
configurations: [{
130
handle: 'my-webhook',
131
label: 'My Webhook',
132
description: 'A description for future self and coworkers',
133
url: 'https://example.com/my-webhook-endpoint',
134
token: 'a-secret-token-to-sign-the-request'
135
active: true
136
events: ['document.published', 'document.unpublished']
137
}
138
}]
139
}
140
​
141
},
142
​
143
// Content Types
144
contentTypes: [{
145
require('./path/to/one/content_type_config'),
146
require('./path/to/another/content_type_config')
147
}],
148
​
149
// Media Types
150
mediaTypes: [{
151
// currently only type 'mediaImage' is supported
152
require('./path/to/media_type_image_config')
153
}],
154
// Editor settings are sent to the editor and control the behavior of your editor
155
editorSettings: {
156
userMenu: [],
157
mainNavigation:[],
158
dashboards: [],
159
mediaLibrary: {}
160
},
161
// Deliveries contains information about the delivery systems you operate
162
deliveries: [{
163
handle: 'web',
164
label: 'Website',
165
isPrimary: true,
166
icon: 'book-open',
167
url: {
168
origin: 'https://example.com',
169
// the available variables in the pattern are:
170
// - :id (document.id)
171
// - :projectId (document.projectId)
172
// - :slug (document.metadata.slug)
173
pathPatterh: '/article/:id'
174
}
175
}]
176
}
Copied!
In a nutshell, the project configuration allows you to:
  • describe general information
  • define contentTypes
  • define mediaTypes
  • define copy options
  • configure the push notifications feature
  • configure the multi-language feature
  • configure integrations
  • configure includeServices for third-party rendering
  • configure the behavior of the editor
Last modified 9mo ago
Copy link