Include HTML blocks Using node.js

前端 未结 5 623
生来不讨喜
生来不讨喜 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:04

    Jade does allow server side includes of HTML blocks and any locals scoped variable will get passed to the included jade template. But the both files must be in jade syntax format not raw HTML if you want to do this.

    Any variable you would like to pass can just be added to the locals object.

提交回复
热议问题