1
0
mirror of https://github.com/JuanCanham/HackMyResume.git synced 2024-06-30 23:40:05 +01:00

Recruit Markdown partials when present.

This commit is contained in:
hacksalot 2016-01-11 12:36:00 -05:00
parent 542776fd2e
commit 7814786957

View File

@ -60,7 +60,7 @@ Definition of the HandlebarsGenerator class.
function registerPartials(format, theme) {
if( format === 'html' || format === 'doc' ) {
if( format === 'html' || format === 'doc' || format == 'md' ) {
// Locate the global partials folder
var partialsFolder = PATH.join(
@ -74,7 +74,7 @@ Definition of the HandlebarsGenerator class.
_.each( READFILES( partialsFolder, function(error){ }), function( el ) {
var pathInfo = parsePath( el );
var name = SLASH( PATH.relative( partialsFolder, el )
.replace(/\.html$|\.xml$/, '') );
.replace(/\.(?:html|xml|hbs|md|txt)$/i, '') );
var tplData = FS.readFileSync( el, 'utf8' );
var compiledTemplate = HANDLEBARS.compile( tplData );
HANDLEBARS.registerPartial( name, compiledTemplate );