Extends

jade允许多个jade文件继承一个jade文件。

jade:

//- layout.jade
doctype html
html
  head
    block title
      title Default title
  body
    block content
//- index.jade
extends ./layout.jade

block title
  title Article Title

block content
  h1 My Article

html:
生成的index.html中

<!doctype html>
<html>
  <head>
    <title>Article Title</title>
  </head>
  <body>
    <h1>My Article</h1>
  </body>
</html>
posted on 2015-11-22 17:01  23333333  阅读(391)  评论(0编辑  收藏  举报