harp
harp copied to clipboard
Macro support
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.