chore(demos): add option to use a custom demo template

This commit is contained in:
Drew Rygh
2015-12-11 11:33:08 -06:00
parent 76122446d4
commit 84cb47dae7
3 changed files with 38 additions and 1 deletions

View File

@ -475,8 +475,11 @@ gulp.task('build.demos', function(){
function createIndexHTML() {
return through2.obj(function(file, enc, next) {
var indexTemplate = baseIndexTemplate;
var customTemplateFp = file.path.split('/').slice(0, -1).join('/') + '/index.html';
if (file.path.indexOf('component-docs') > -1) {
indexTemplate = docsIndexTemplate;
} else if (fs.existsSync(customTemplateFp)) {
indexTemplate = _.template(fs.readFileSync(customTemplateFp))();
}
this.push(new VinylFile({
base: file.base,