Includes and Macros

from blog The Darth Mall, | ↗ original
When you're working with Nunjucks (or Jinja2), you have two[1] options for creating reusable bits of template: includes (I often refer to these as "partials") and macros. It's not always obvious why you should choose one over another. Just about anything you can do with a macro can also be done with a template include[2]. The heuristic I follow...