|
1 |
| -/* |
2 |
| - * patternlab-node - v2.2.1 - 2016 |
3 |
| - * |
| 1 | +/* |
| 2 | + * patternlab-node - v2.2.1 - 2016 |
| 3 | + * |
4 | 4 | * Brian Muenzenmeyer, Geoff Pursell, and the web community.
|
5 |
| - * Licensed under the MIT license. |
6 |
| - * |
7 |
| - * Many thanks to Brad Frost and Dave Olsen for inspiration, encouragement, and advice. |
| 5 | + * Licensed under the MIT license. |
| 6 | + * |
| 7 | + * Many thanks to Brad Frost and Dave Olsen for inspiration, encouragement, and advice. |
8 | 8 | *
|
9 | 9 | */
|
10 | 10 |
|
@@ -358,15 +358,23 @@ var patternlab_engine = function (config) {
|
358 | 358 | patternLabFoot : footerPartial
|
359 | 359 | });
|
360 | 360 |
|
| 361 | + //default the output suffixes if not present |
| 362 | + var outputFileSuffixes = { |
| 363 | + rendered: '', |
| 364 | + rawTemplate: '', |
| 365 | + markupOnly: '.markup-only' |
| 366 | + } |
| 367 | + outputFileSuffixes = _.extend(outputFileSuffixes, patternlab.config.outputFileSuffixes); |
| 368 | + |
361 | 369 | //write the compiled template to the public patterns directory
|
362 | 370 | var patternPage = headHTML + pattern.patternPartialCode + footerHTML;
|
363 |
| - fs.outputFileSync(paths.public.patterns + pattern.patternLink, patternPage); |
| 371 | + fs.outputFileSync(paths.public.patterns + pattern.patternLink.replace('.html', outputFileSuffixes.rendered + '.html'), patternPage); |
364 | 372 |
|
365 | 373 | //write the mustache file too
|
366 |
| - fs.outputFileSync(paths.public.patterns + pattern.patternLink.replace('.html', pattern.fileExtension), pattern.template); |
| 374 | + fs.outputFileSync(paths.public.patterns + pattern.patternLink.replace('.html', outputFileSuffixes.rawTemplate + pattern.fileExtension), pattern.template); |
367 | 375 |
|
368 | 376 | //write the encoded version too
|
369 |
| - fs.outputFileSync(paths.public.patterns + pattern.patternLink.replace('.html', '.markup-only.html'), pattern.patternPartialCode); |
| 377 | + fs.outputFileSync(paths.public.patterns + pattern.patternLink.replace('.html', outputFileSuffixes.markupOnly + '.html'), pattern.patternPartialCode); |
370 | 378 |
|
371 | 379 | return true;
|
372 | 380 | });
|
|
0 commit comments