How to chose your Template Engine
Template Engine: A flexible Template Engine with client & server mode
Your front-end templates should be able to get rendered both in your server or in your browser in JavaScript (or TypeScript) without pain. So the last banner template you did for the home page can be easily re-used for an overlay appearing before the visitor exits the page.
Also, a template engine with a minimum capacity for processing logic (e.g.: formatting strings, conditional parameters, etc.) like Nunjucks will facilitate your templates to have the required rendering logic built-in, avoiding the need to have any business logic in your code between the call of Boxalino Narrative API and the rendering in your view.
In addition, Boxalino Template Engines can access directly to your Template Library and manage the displays of overlays throughout the page visit (scroll-behavior, minimum time on page, pause to look at something, etc.) and automate the triggering of calls to Boxalino Narrative API without that you have to program anything while making direct usage of all the templates you have created for your front-end.
To get a maximum value out of your Templates (and their JSON Styles), we recommend storing all your Boxalino Layout Block Schemas and their JSON Styles in a git repository and to give access to Boxalino. This way, Boxalino will be able to import automatically the latest version of your templates and integrate them in the Boxalino Admin and the Boxalino deployment process. Such an approach has the big advantage that you don’t need to configure such aspects manually in Boxalino Admin which can limit your agility to do releases.
Learn more about how a Template Engine is a key part of your future front-end architecture here: Our Best Practice for your New Front-End
Nunjucks
Seems like a quite good engine with a lot of possibilities to create functions and other logic which would make the templates possibly quite autonomous and could therefore be easily re-used as provided (with the required logic inside) for client-side rendering.
https://mozilla.github.io/nunjucks/
Mustache
Nice, but too simplistic as it doesn’t provide any real options to manipulate the data in the rendering (even for simple number formatting).
Handlebars
Same comment as Mustache
Resource
https://colorlib.com/wp/top-templating-engines-for-javascript/