harp icon indicating copy to clipboard operation
harp copied to clipboard

Macro support

Open mmarcon opened this issue 10 years ago • 0 comments

This pull request introduces the concept of macro (maybe it can be named something more meaningful).

Applications built with harp can include a _macros folder in the project root and add node.js modules into this folder. Functions and objects exported by modules will be available in the global scope and accessible from templates as

<%- macros.someFunction() %>

This helps keeping code/logic out of templates and avoid code like http://harpjs.com/recipes/blog-sitemap.

It opens up harp to lots of freedom for more expert developers who want a more customized harp experience.

mmarcon avatar Nov 13 '14 11:11 mmarcon