-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
41 lines (32 loc) · 1.06 KB
/
index.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
var Path = require('path');
var entities = new (require('html-entities').AllHtmlEntities);
function EmberCLIWhitelabel(project) {
this.project = project;
this.name = 'Ember CLI Whitelabel';
}
EmberCLIWhitelabel.prototype.included = function included(app) {
this.app = app;
this.options = app.options.whitelabel || {};
};
EmberCLIWhitelabel.prototype.contentFor = function contentFor(type/*, config*/) {
if (type === 'head') {
var head = [];
if (this.options.title) {
head.push(' <title>' + entities.encode(this.options.title) + '</title>');
}
if (this.options.description) {
head.push(' <meta name="description" content="' + entities.encode(this.options.description) + '">')
}
return head;
}
};
EmberCLIWhitelabel.prototype.treeFor = function treeFor(type) {
var label = this.options.label || 'default';
if (type === 'styles') {
return Path.join('config', 'labels', label, 'styles');
}
if (type === 'public') {
return Path.join('config', 'labels', label, 'public');
}
};
module.exports = EmberCLIWhitelabel;