【问题标题】:Adding a footer or other partial in jade在翡翠中添加页脚或其他部分
【发布时间】:2015-02-08 06:06:07
【问题描述】:

我想在布局中添加一个页脚,以便在我的 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

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

【问题讨论】:

    标签: node.js express pug


    【解决方案1】:

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

    layout.jade

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

    【讨论】:

    • 来自未来的评论。感谢您回来完成故事
    猜你喜欢
    • 1970-01-01
    • 2012-03-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-04-28
    • 2013-05-19
    • 1970-01-01
    • 2014-03-19
    相关资源
    最近更新 更多