Template engine for node.js

I am looking for a templated engine to meet these specific requirements:

Must be:

  • logical support (if / else / etc)
  • file inclusion / inheritance (e.g. child / core templates)
  • not haml

Desired:

  • rich tags / filters (a-la Django)
  • custom tags / filters
+3
source share
2 answers

It looks like simonw djangode is what I need:

Here's how you download it:

loader.load_and_render('template.html', context, function (error, result) {
    if (error) {
        dj.default_show_500(req, res, error);
    } else {
        dj.respond(res, result, 'text/plain');
    }
});

And the template syntax seems like a full port for Django 1.1 templates

+1
source

Jade , "" / Node. HAML, HAML. .

master/child, TJ (), , , . (, ), .

EDIT: Jade : https://github.com/visionmedia/jade#a11

+2

Source: https://habr.com/ru/post/1772575/


All Articles