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?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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).