zoukankan      html  css  js  c++  java
  • Jade之Includes

    Includes

    jade允许利用include将其他文件(支持filters所支持的类型)中的代码嵌入当前代码中。

    jade:

    //- index.jade
    doctype html
    html
      include ./includes/head.jade
      body
        h1 My Site
        p Welcome to my super lame site.
        include ./includes/foot.jade
    
    //- includes/head.jade
    head
      title My Site
      script(src='/javascripts/jquery.js')
      script(src='/javascripts/app.js')
    
    //- includes/foot.jade
    #footer
      p Copyright (c) foobar
    

    html:
    index.html

    <!doctype html>
    <html>
      <head>
        <title>My Site</title>
        <script src='/javascripts/jquery.js'></script>
        <script src='/javascripts/app.js'></script>
      </head>
      <body>
        <h1>My Site</h1>
        <p>Welcome to my super lame site.</p>
        <div id="footer">
          <p>Copyright (c) foobar</p>
        </div>
      </body>
    </html>
    
  • 相关阅读:
    平时十二测
    无题十四
    暑假第十测
    无题十三
    noip错题集
    无题十二
    BZOJ整理
    志愿者招募
    修车
    任务安排
  • 原文地址:https://www.cnblogs.com/wsy06/p/4986206.html
Copyright © 2011-2022 走看看