Express,玉石布局文件渲染体而不是渲染头

我的问题是我的玉石布局文件不能正确渲染。 呈现正文,但生成的html中的头标记是空的。 我试图单独呈现layout.jade文件,它完美的作品。

这是我的layout.jade文件

!!! html head title= title link(rel='stylesheet', href='stylesheets/style.css') script(type='text/javascript', src='javascripts/jquery-1.7.2.js') link(rel='stylesheet', href='stylesheets/pictogram-button.css') body header(style='padding-bottom:50px;') include partials/header section(style='min-height:600px;') div!= body footer.footer include partials/footer 

这里是我的index.jade文件

 .line_h100t .column_wrap800 .round_box1_w800 .list_fl10 ul.line_h40 li(style='margin-left:20px;') ul li img(src='/images/icon/whiteWithoutCircle/check.png') img(src='/images/login/loginTxt.png') ul.line_h40t li(style='margin-left:50px;') p 로그인이 필요하신 분은 p Oopa Roopa 관리팀으로 문의해 주세요! li(style='border-left:1px solid #999; padding:0 0 0 20px;') ul li span.text_yellow ID ul li input.login_input(type='text') ul.line_h35t li span.text_yellow PASSWORD ul li input.login_input(type='password') li ul.line_h10t a.button-bevel.transparency(href='#') .line_h35 span.lock p(style='width:100px;') LOGIN 

这是我的快速应用程序中呈现索引文件的function。

  adminLogin : function (req,res) { res.render( 'index', { title: 'Admin Login', pageCategory: 'Admin Login', pageName : 'index' }); }, 

预先感谢您给我的任何帮助。

在expression式3中,布局被移除以支持模板inheritance,如此处所述。 玉自述描述了这是如何工作的,另外一个例子是在这里 。

您将需要用block body (或类似的)replacediv!= body 。 然后在index.jade的顶部,您将需要添加extends layout 。 最后把index.jade的内容放在一个block body (或者你在layout.jade使用的任何名字)下面。