forked from NodeBB/nodebb-plugin-custom-homepage
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlibrary.js
50 lines (44 loc) · 906 Bytes
/
library.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
(function(module) {
"use strict";
var Plugin = {};
Plugin.serveHomepage = function(params){
params.res.render('homepage', {
template: {
name: 'homepage'
}
});
};
Plugin.addListing = function(data, callback){
data.routes.push({
route: 'customHP',
name: 'Custom Homepage'
});
callback(null, data);
};
Plugin.defineWidgetAreas = function(areas, callback) {
areas = areas.concat([
{
'name': 'Custom HP Header',
'template': 'homepage.tpl',
'location': 'hp-header'
},
{
'name': 'Custom HP Footer',
'template': 'homepage.tpl',
'location': 'hp-footer'
},
{
'name': 'Custom HP Sidebar',
'template': 'homepage.tpl',
'location': 'hp-sidebar'
},
{
'name': 'Custom HP Content',
'template': 'homepage.tpl',
'location': 'hp-content'
}
]);
callback(null, areas);
};
module.exports = Plugin;
}(module));