【发布时间】:2015-05-19 11:28:14
【问题描述】:
我使用 Jade 模板引擎。我需要更改主页中的部分标题。
h1.text-center.main-title| The title here
标题来自此代码的页面的其他部分
include ./parts/_page-header.jade
我尝试使用 case、block 和 vars 这对我不起作用
我需要任何方式在页面中包含该部分并仅更改此页面中的标题内容。
【问题讨论】:
-
你应该将标题传递给本地对象并写
h1=locals.pageTitle
标签: javascript node.js pug template-engine