From 228f14d06c72e5e125c21825e8863f0c9795631e Mon Sep 17 00:00:00 2001 From: devlinjd Date: Sun, 6 Dec 2015 18:19:33 -0500 Subject: [PATCH] Support recursive theme template loading. --- package.json | 1 + src/core/theme.js | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 91a401c..ee3a1b8 100644 --- a/package.json +++ b/package.json @@ -44,6 +44,7 @@ "minimist": "^1.2.0", "mkdirp": "^0.5.1", "moment": "^2.10.6", + "recursive-readdir-sync": "^1.0.6", "underscore": "^1.8.3", "wkhtmltopdf": "^0.1.5", "xml-escape": "^1.0.0", diff --git a/src/core/theme.js b/src/core/theme.js index c910c65..3f5c0eb 100644 --- a/src/core/theme.js +++ b/src/core/theme.js @@ -11,7 +11,8 @@ Abstract theme representation. , _ = require('underscore') , PATH = require('path') , 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. @@ -42,7 +43,7 @@ Abstract theme representation. // Iterate over all files in the theme folder, producing an array, fmts, // containing info for each file. 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 pathInfo = PATH.parse(absPath); var temp = [ pathInfo.name, {