diff --git a/src/core/theme.js b/src/core/theme.js index 26ddd65..bb86a06 100644 --- a/src/core/theme.js +++ b/src/core/theme.js @@ -81,6 +81,7 @@ Abstract theme representation. // Set up a hash of formats supported by this theme. var formatsHash = { }; var that = this; + var major = false; // Establish the base theme folder var tplFolder = PATH.join( this.folder, 'src' ); @@ -94,7 +95,7 @@ Abstract theme representation. // such as "/latex" or "/html", then that format is the output format // for all files within the folder. var pathInfo = PATH.parse(absPath); - var outFmt = ''; + var outFmt = '', isMajor = false; var portion = pathInfo.dir.replace(tplFolder,''); if( portion && portion.trim() ) { var reg = /^(?:\/|\\)(html|latex|doc|pdf)(?:\/|\\)?/ig; @@ -106,7 +107,8 @@ Abstract theme representation. // compact-[outputformat].[extension], for ex, compact-pdf.html. if( !outFmt ) { var idx = pathInfo.name.lastIndexOf('-'); - outFmt = ( idx === -1 ) ? pathInfo.name : pathInfo.name.substr( idx + 1 ) + outFmt = ( idx === -1 ) ? pathInfo.name : pathInfo.name.substr( idx + 1 ); + isMajor = true; } // We should have a valid output format now. @@ -119,6 +121,7 @@ Abstract theme representation. var obj = { action: 'transform', path: absPath, + major: isMajor, orgPath: PATH.relative(that.folder, absPath), ext: pathInfo.ext.slice(1), title: friendlyName( outFmt ), diff --git a/src/gen/template-generator.js b/src/gen/template-generator.js index 0a65ff8..2db20b1 100644 --- a/src/gen/template-generator.js +++ b/src/gen/template-generator.js @@ -196,7 +196,7 @@ Template-based resume generator base for FluentCV. var thisFilePath = PATH.join( outFolder, tplInfo.orgPath ); try { MKDIRP.sync( PATH.dirname(thisFilePath) ); - FS.writeFileSync( thisFilePath, mk, { encoding: 'utf8', flags: 'w' } ); + FS.writeFileSync( tplInfo.major ? f : thisFilePath, mk, { encoding: 'utf8', flags: 'w' } ); } catch(ex) { console.log(ex);