Jade之Extends

Extends

jade容許多個jade文件繼承一個jade文件。html

jade:code

//- 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中htm

<!doctype html>
<html>
  <head>
    <title>Article Title</title>
  </head>
  <body>
    <h1>My Article</h1>
  </body>
</html>
相關文章
相關標籤/搜索