You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Templates are written as separate .handlebars files, inside a (subfolder of a) folder in Django apps called "hbtemplates". The templates are then bundled into "modules" (based on the subfolder name) that can be loaded for use on the client side.
E.g. (if your module name is modname):
Create a template file in kalite/main/hbtemplates/modname/my-template.handlebars
Add <script src="{% url 'handlebars_templates' module_name='modname' %}"></script> in your template, to load the module with all its templates
Reference the executable template with var my_template = HB.template("modname/my-template")
When you want to render your template, just run it as a function, passing in a context object, e.g. var my_html = my_template({name: "Sally", age: 43}).