Reputation: 1314
I'm using Jade as templating engine for an app on node.js/express.
I don't want to repeat code in different views. Is there any way to define macros/includes/functions like in freemarker?
Upvotes: 0
Views: 756
Reputation: 169451
Use partial views.
Check out the screencasts specifically the partial view one.
Be wary partials are defined by express and not the view engine. You'll have to emulate them if you want to use your views outside of express (the API for partials is pretty good).
Upvotes: 1