Include HTML blocks Using node.js

前端 未结 5 624
生来不讨喜
生来不讨喜 2021-02-04 09:01

This is what I want but probably can\'t have:

Using node.js and express and maybe ejs, I would like to, while writing a regular HTML file in my client dir, server-side-i

5条回答
  •  清歌不尽
    2021-02-04 09:14

    I would recommend nunjucks or pejs. Nunjucks is jinja-inspired, while pejs is just ejs + inheritance, block, and file support.

    pejs has some issues with space chomping at the moment, but it's still pretty useful. Of the two, I prefer the separation layer that comes with nunjucks.

    Jade is pretty cool and has the feature-set you're looking for, but it has a very unique syntax. References for jade: template inheritance, blocks, includes

提交回复
热议问题