Skip to content

Commit

Permalink
Use partialIndent hbs option to prevent indent issues
Browse files Browse the repository at this point in the history
  • Loading branch information
ErisDS committed Mar 10, 2015
1 parent 4ab59c2 commit cf9eb5b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
13 changes: 12 additions & 1 deletion core/server/middleware/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,18 @@ function activateTheme(activeTheme) {
blogApp.cache = {};

// set view engine
hbsOptions = {partialsDir: [config.paths.helperTemplates]};
hbsOptions = {
partialsDir: [config.paths.helperTemplates],
// override the default compile
onCompile: function(exhbs, source, filename) {
var options;
if (filename && filename.indexOf('partials') !== -1) {
options = {preventIndent: true};
}

return exhbs.handlebars.compile(source, options);
}
};

fs.stat(themePartials, function (err, stats) {
// Check that the theme has a partials directory before trying to use it
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"connect-slashes": "1.3.0",
"downsize": "0.0.8",
"express": "4.12.0",
"express-hbs": "0.7.11",
"express-hbs": "0.8.2",
"extract-zip": "1.0.3",
"fs-extra": "0.13.0",
"glob": "4.3.2",
Expand Down

0 comments on commit cf9eb5b

Please sign in to comment.