在玉中添加页脚或其他部分内容

JGa*_*rdo 4 node.js express pug

我想在我的Express应用程序的所有页面上使用的布局中添加页脚.我跟着这个相关的教程

http://www.devthought.com/code/use-jade-blocks-not-layouts/

但我似乎错过了一些东西.这是我的代码.

layout.jade

doctype html
html
  head
    title= title
    link(rel='stylesheet', href='/stylesheets/style.css')
  body
    block content

    block footer
Run Code Online (Sandbox Code Playgroud)

footer.jade

extends layout

block footer
  footer
    ul
      li
        a(href="/team") Team
      li
        a(href="/privacy") Privacy
      p
        | company name <br> 
        | &copy; 2014, All Rights Reserved
Run Code Online (Sandbox Code Playgroud)

JGa*_*rdo 8

显然它可以使用包含.我将它添加到我的布局中,因为它在所有页面上都是相同的.

layout.jade

doctype html
html
  head
    title= title
    link(rel='stylesheet', href='/stylesheets/style.css')
  body
    block content

    include footer
Run Code Online (Sandbox Code Playgroud)

  • 评论未来.谢谢你回来完成这个故事 (2认同)