I can use client-side templates for nunjucks as I am compiling from node.js and exposing JS template files. I call client templates like this:
nunjucks.render('partials/some-template.html', { abc: 123 })
and return the string.
How can I call macros as I tried, but am doing it wrong. Macros are first declared on the page in terms of node.js, and then called sequential moments, for example, in node.js:
{% include 'macros/checkbox.html' %} ... {{ checkbox('you cool?', 'cool', false) }} {{ checkbox('you collected?', 'collected', false) }}
But not sure how to get the macro, and then call it again and again on the client side. I made an attempt to go through the inspection in the console so far, but no luck.
source share