diff --git a/index.js b/index.js
index f18a494..0306916 100644
--- a/index.js
+++ b/index.js
@@ -10,6 +10,13 @@ module.exports = {
this.svgSources = app.options.icons.svgSources;
this.iconCSSTemplate = app.options.icons.cssTemplate;
this.iconOutput = app.options.icons.dest;
+ this.iconFontName = app.options.icons.fontName;
+ this.iconNoHash = app.options.icons.noHash;
+ this.includeTemplate = app.options.icons.includeTemplate;
+
+ this.iconDestPath = this.iconOutput ?
+ path.join('assets', this.iconOutput) :
+ 'assets';
}
// Store appRoot so fontcustom can find the icon sources
this.appRoot = app.project.root;
@@ -18,17 +25,14 @@ module.exports = {
},
contentFor: function(type) {
- if (type === 'head') {
- return '';
+ if (type === 'head' && this.includeTemplate !== false) {
+ return '';
}
},
// Build font files
// TODO this isn't ideal - icons.css should be included in my SCSS/LESS build
treeForPublic: function(tree) {
- var iconDestPath = this.iconDest ?
- path.join('assets', this.iconDest) :
- 'assets';
var svgSources = this.svgSources || path.join('app', 'styles', 'icons');
if (typeof svgSources === 'string') {
svgSources = path.join(this.appRoot, svgSources);
@@ -38,8 +42,10 @@ module.exports = {
path.join(__dirname, 'addon', 'icons.css');
var fontTree = fontcustom(svgSources, {
- output: iconDestPath,
- templates: [ templatePath ]
+ output: this.iconDestPath,
+ templates: [ templatePath ],
+ 'font-name': this.iconFontName,
+ 'no-hash': this.iconNoHash
});
return mergeTrees([ tree, fontTree ]);
}