I am building a medium size html/scss/ts website. Since it is fairly complex with a lot of repetitive elements (layouts, repetive blocks) I started researching good SSG options (ended up using 11ty) and templating engines. However, after a long search and trying multiple templating engine, I dind't found any suitable. I was looking for two points which are minimum: ability to create extend template with placeholders for content (used for layouts) and ability to include partial with parameter, and bonus - ability to provide content to partials using slot/blocks.
I tried Nunjucks, EJS, and Mustache. None of them fulfilled all criteria. Which templating engine do you use which fulfills all of the above?
Nunjucks: have extends, but you can't pass data to include (there is an option to use a macro, but doesn't look clean) EJS: have the ability to pass data to include partial, but no option to extend
Btw, I am not interested in alternatives like Pug or Haml. Just regular HTML templating engines.
For complex multi-page sites, I like Nunjucks the best. Here is the demo multi page site using the Nunjucks template engine.
You can try the liquidjs. It should fill your criteria.
This template engine support the
layout(works likeextends):layout.liquid
page.liquid
You can pass variables into including partials: