1
0
mirror of https://github.com/JuanCanham/HackMyResume.git synced 2024-11-05 09:56:22 +00:00

Support recursive theme template loading.

This commit is contained in:
devlinjd 2015-12-06 18:19:33 -05:00
parent 307c37dc44
commit 228f14d06c
2 changed files with 4 additions and 2 deletions

View File

@ -44,6 +44,7 @@
"minimist": "^1.2.0", "minimist": "^1.2.0",
"mkdirp": "^0.5.1", "mkdirp": "^0.5.1",
"moment": "^2.10.6", "moment": "^2.10.6",
"recursive-readdir-sync": "^1.0.6",
"underscore": "^1.8.3", "underscore": "^1.8.3",
"wkhtmltopdf": "^0.1.5", "wkhtmltopdf": "^0.1.5",
"xml-escape": "^1.0.0", "xml-escape": "^1.0.0",

View File

@ -11,7 +11,8 @@ Abstract theme representation.
, _ = require('underscore') , _ = require('underscore')
, PATH = require('path') , PATH = require('path')
, EXTEND = require('../utils/extend') , EXTEND = require('../utils/extend')
, moment = require('moment'); , moment = require('moment')
, recursiveReadSync = require('recursive-readdir-sync');
/** /**
The Theme class is a representation of a FluentCV theme asset. The Theme class is a representation of a FluentCV theme asset.
@ -42,7 +43,7 @@ Abstract theme representation.
// Iterate over all files in the theme folder, producing an array, fmts, // Iterate over all files in the theme folder, producing an array, fmts,
// containing info for each file. // containing info for each file.
var tplFolder = PATH.join( themeFolder, 'src' ); var tplFolder = PATH.join( themeFolder, 'src' );
var fmts = FS.readdirSync( tplFolder ).map( function( file ) { var fmts = recursiveReadSync( tplFolder ).map( function( file ) {
var absPath = PATH.join( tplFolder, file ); var absPath = PATH.join( tplFolder, file );
var pathInfo = PATH.parse(absPath); var pathInfo = PATH.parse(absPath);
var temp = [ pathInfo.name, { var temp = [ pathInfo.name, {