有没有任何一个Node.js模板引擎支持像PHP Smarty一样的模板继承功能?

4

有没有任何nodejs模板引擎支持像PHP Smarty那样的模板继承功能?

{block name=head}
default layout content
{/block}

{block name=head}
if page have customize the content it display the customize content, otherwise display the layout content
{/block}

1
https://github.com/visionmedia/jade#a12 - generalhenry
Jade很棒,将通过extends关键字支持继承! - Noah
看一下atpl:https://github.com/soywiz/atpl.js - 它基于PHP的Twig,并具有完整的继承支持。 - Criss
1个回答

1
尝试使用 LinkedIn 版本的 dust.js:https://github.com/linkedin/dustjs 它看起来会像这样:
{+head}默认布局内容{/head}
dust.js 还支持以下功能: - 异步/流式操作 - 浏览器/节点兼容性 - 扩展的 Mustache/ctemplate 语法 - 干净、低级别的 API - 高性能 - 可组合的模板

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接