-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
144 lines (125 loc) · 3.8 KB
/
app.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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
/* jshint node:true */
require('dotenv').config({silent: true});
var fs = require('fs');
var site = require('apostrophe-site')();
site.init({
// This line is required and allows apostrophe-site to use require() and manage our NPM modules for us.
root: module,
shortName: 'vvrc_cms',
hostName: 'vajravidya.com',
title: 'Vajra Vidya Retreat Center',
sessionSecret: process.env.SESSION_SECRET,
adminPassword: process.env.ADMIN_PASSWORD,
// Force a2 to prefix all of its URLs. It still
// listens on its own port, but you can configure
// your reverse proxy to send it traffic only
// for URLs with this prefix. With this option
// "/" becomes a 404, which is supposed to happen!
// prefix: '/test',
// If true, new tags can only be added by admins accessing
// the tag editor modal via the admin bar. Sometimes useful
// if your folksonomy has gotten completely out of hand
lockTags: false,
// Give users a chance to log in if they attempt to visit a page
// which requires login
secondChanceLogin: true,
locals: require('./lib/locals.js'),
// you can define lockups for areas here
// lockups: {},
// Here we define what page templates we have and what they will be called in the Page Types menu.
// For html templates, the 'name' property refers to the filename in ./views/pages, e.g. 'default'
// refers to '/views/pages/default.html'.
// The name property can also refer to a module, in the case of 'blog', 'map', 'events', etc.
pages: {
types: [
{ name: 'default', label: 'Default Page' },
{ name: 'home', label: 'Home Page' },
{ name: 'blog', label: 'Blog' }
]
},
lockups: {
left: {
label: 'Left',
tooltip: 'Inset Left',
icon: 'icon-arrow-left',
widgets: [ 'slideshow', 'video' ],
slideshow: {
size: 'one-half'
}
},
right: {
label: 'Right',
tooltip: 'Inset Right',
icon: 'icon-arrow-right',
widgets: [ 'slideshow', 'video' ],
slideshow: {
size: 'one-half'
}
}
},
// These are the modules we want to bring into the project.
modules: {
// Styles required by the new editor, must go FIRST
'apostrophe-editor-2': {},
'apostrophe-ui-2': {},
'apostrophe-blog-2': {
perPage: 5,
pieces: {
addFields: [
{
name: '_author',
type: 'joinByOne',
withType: 'person',
idField: 'authorId',
label: 'Author'
}
]
}
},
'apostrophe-people': {
addFields: [
{
name: '_blogPosts',
type: 'joinByOneReverse',
withType: 'blogPost',
idField: 'authorId',
label: 'Author',
withJoins: [ '_editor' ]
},
{
name: 'thumbnail',
type: 'singleton',
widgetType: 'slideshow',
label: 'Picture',
options: {
aspectRatio: [100,100]
}
}
]
},
'apostrophe-groups': {},
'apostrophe-browserify': {
files: ["./public/js/modules/_site.js"]
//},
//'apostrophe-demo-login': {
}
},
// These are assets we want to push to the browser.
// The scripts array contains the names of JS files in /public/js,
// while stylesheets contains the names of LESS files in /public/css
assets: {
stylesheets: ['site'],
scripts: ['_site-compiled']
},
afterInit: function(callback) {
// We're going to do a special console message now that the
// server has started. Are we in development or production?
var locals = require('./data/local');
if(locals.development || !locals.minify) {
console.error('Apostrophe site is running in development.');
} else {
console.error('Apostrophe site is running in production.');
}
callback(null);
}
});