Skip to content

Commit

Permalink
Specify template files via configuration
Browse files Browse the repository at this point in the history
closes #683
  • Loading branch information
bmuenzenmeyer committed Sep 17, 2017
1 parent 7a9994c commit 9b16f26
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
10 changes: 5 additions & 5 deletions core/lib/patternlab.js
Original file line number Diff line number Diff line change
Expand Up @@ -541,11 +541,11 @@ const patternlab_engine = function (config) {
patternlab.listitems = {};
}
try {
patternlab.header = fs.readFileSync(path.resolve(paths.source.patternlabFiles, 'partials', 'general-header.mustache'), 'utf8');
patternlab.footer = fs.readFileSync(path.resolve(paths.source.patternlabFiles, 'partials', 'general-footer.mustache'), 'utf8');
patternlab.patternSection = fs.readFileSync(path.resolve(paths.source.patternlabFiles, 'partials', 'patternSection.mustache'), 'utf8');
patternlab.patternSectionSubType = fs.readFileSync(path.resolve(paths.source.patternlabFiles, 'partials', 'patternSectionSubtype.mustache'), 'utf8');
patternlab.viewAll = fs.readFileSync(path.resolve(paths.source.patternlabFiles, 'viewall.mustache'), 'utf8');
patternlab.header = fs.readFileSync(path.resolve(paths.source.patternlabFiles['general-header']), 'utf8');
patternlab.footer = fs.readFileSync(path.resolve(paths.source.patternlabFiles['general-footer']), 'utf8');
patternlab.patternSection = fs.readFileSync(path.resolve(paths.source.patternlabFiles.patternSection), 'utf8');
patternlab.patternSectionSubType = fs.readFileSync(path.resolve(paths.source.patternlabFiles.patternSectionSubtype), 'utf8');
patternlab.viewAll = fs.readFileSync(path.resolve(paths.source.patternlabFiles.viewall), 'utf8');
} catch (ex) {
console.log(ex);
plutils.error('\nERROR: missing an essential file from ' + paths.source.patternlabFiles + '. Pattern Lab won\'t work without this file.\n');
Expand Down
8 changes: 7 additions & 1 deletion test/util/patternlab-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,13 @@
"data" : "./test/files/_data/",
"meta": "./test/files/_meta/",
"styleguide" : "./test/files/styleguide/",
"patternlabFiles" : "./test/files/",
"patternlabFiles" : {
"general-header": "./test/files/partials/general-header.mustache",
"general-footer": "./test/files/partials/general-footer.mustache",
"patternSection": "./test/files/partials/patternSection.mustache",
"patternSectionSubtype": "./test/files/partials/patternSectionSubtype.mustache",
"viewall": "./test/files/viewall.mustache"
},
"js" : "./test/files/js",
"images" : "./test/files/images",
"fonts" : "./test/files/fonts",
Expand Down

0 comments on commit 9b16f26

Please sign in to comment.