-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkeystone.js
executable file
·104 lines (80 loc) · 2.69 KB
/
keystone.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
// Simulate config options from your production environment by
// customising the .env file in your project's root folder.
require('dotenv').config();
// Require keystone
var keystone = require('keystone');
// Initialise Keystone with your project's configuration.
// See http://keystonejs.com/guide/config for available options
// and documentation.
keystone.init({
'name': 'André Knörig',
'brand': 'André Knörig',
'less': 'public',
'static': 'public',
'favicon': 'public/favicon.ico',
'views': 'templates/views',
'view engine': 'pug',
'emails': 'templates/emails',
'wysiwyg images': true,
'wysiwyg cloudinary images': true,
'wysiwyg additional buttons': 'formatselect removeformat blockquote',
'auto update': true,
'session': true,
'auth': true,
'user model': 'User',
'cookie secret': 'q!ckvQh`v>ku}}.H[<m@abwXs9?r<g@/f4zdV{d6pyy3IrBoC<]`hvSds$w[N9RW',
'mongo options': {
useNewUrlParser: true,
useUnifiedTopology: true,
dbName: 'andreknoerig'
},
'ga property': process.env.GA_PROPERTY,
'ga domain': process.env.GA_DOMAIN
});
// Load your project's Models
keystone.import('models');
// Setup common locals for your templates. The following are required for the
// bundled templates and layouts. Any runtime locals (that should be set uniquely
// for each request) should be added to ./routes/middleware.js
keystone.set('locals', {
_: require('underscore'),
moment: require('moment'),
env: keystone.get('env'),
utils: keystone.utils,
editable: keystone.content.editable,
ga_property: keystone.get('ga property'),
ga_domain: keystone.get('ga domain'),
embedly_api_key: keystone.get('embedly api key')
});
// Load your project's Routes
keystone.set('routes', require('./routes'));
// Setup common locals for your emails. The following are required by Keystone's
// default email templates, you may remove them if you're using your own.
keystone.set('email locals', {
logo_src: '/images/logo-email.gif',
logo_width: 194,
logo_height: 76,
theme: {
email_bg: '#f9f9f9',
link_color: '#2697de',
buttons: {
color: '#fff',
background_color: '#2697de',
border_color: '#1a7cb7'
}
}
});
// Setup replacement rules for emails, to automate the handling of differences
// between development a production.
// ..
// Configure the navigation bar in Keystone's Admin UI
keystone.set('nav', {
'works': ['projects', 'project-categories'],
'activities': ['activities', 'activity-categories', 'publications', 'publication-categories'],
'tags': ['organizations', 'industries', 'interactions', 'technologies'],
'blog': ['posts', 'post-categories'],
'contact': 'enquiries',
'users': 'users'
});
// Start Keystone to connect to your database and initialise the web server
keystone.start();