【发布时间】:2014-07-03 02:16:06
【问题描述】:
所以我使用jade构建了几个网页,但是我的登录页面在其他页面中的不同之处在于它没有菜单。除了它共享相同的页眉和页脚。我的问题是我想有条件地将 menu.jade 包含在转换为 html 中。我想做这样的事情:
base.jade:
doctype html
head
title= title
body
block menu
block content
include footer
menu.jade
extends base
ul
li Home
li Contact
index.jade:
extends base
block content
p hello landingpage
page.jade
extends base
block content
p hello subpage
问题是:当我转换 index.jade 时,一切都很好;我的页面看起来像我想要的那样。但是当我转换 page.jade 时,我不知何故也想包含 menu.jade,o 我不必在所有子页面中重写我的菜单。
【问题讨论】:
标签: node.js pug template-engine