Skip to content

Commit

Permalink
feat: handlebars helpers "is" and "has"
Browse files Browse the repository at this point in the history
  • Loading branch information
wesleyboar committed Jul 19, 2023
1 parent 49789a3 commit bd59440
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
9 changes: 9 additions & 0 deletions fractal.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,5 +90,14 @@ fractal.web.set('builder.dest', __dirname + '/demo');
// Customize theme
fractal.web.theme(theme);

// Add template helpers
const engine = fractal.components.engine();
engine.handlebars.registerHelper('eq', function(a, b) {
return a == b;
});
engine.handlebars.registerHelper('has', function(array, item) {
return array.includes(item);
});

// Export
module.exports = fractal;
1 change: 1 addition & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
},
"devDependencies": {
"@frctl/fractal": "^1.5.13",
"@frctl/handlebars": "^1.2.15",
"@frctl/mandelbrot": "^1.10.1",
"minimist": "^1.2.7",
"npm-watch": "^0.11.0"
Expand Down

0 comments on commit bd59440

Please sign in to comment.