diff --git a/src/middleware/index.js b/src/middleware/index.js index f15394ca68..c3ab7ceb42 100644 --- a/src/middleware/index.js +++ b/src/middleware/index.js @@ -106,13 +106,12 @@ function compileTemplates() { matches = null; while (matches = file.match(//)) { - var partial = ""; - if (paths["/" + matches[1]]) { - partial = fs.readFileSync(paths["/" + matches[1]]).toString(); + file = file.replace(//, fs.readFileSync(paths["/" + matches[1]]).toString()); + } else { + winston.warn('[themes] Partial not found: ' + matches[1]); + file = file.replace(//, ""); } - - file = file.replace(//, partial); } mkdirp.sync(path.join(nconf.get('views_dir'), relative_path.split('/').slice(0, -1).join('/')));