File: extends.jade

package info (click to toggle)
node-jade 1.5.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: buster, jessie, jessie-kfreebsd, stretch
  • size: 1,984 kB
  • ctags: 315
  • sloc: makefile: 4
file content (50 lines) | stat: -rw-r--r-- 1,111 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
extends ../reference.jade

block documentation
  h1 Extends - Template Inheritance

  p.
    The #[code extends] keyword allows a template to extend a layout or parent template.
    It can then override certain pre-defined blocks of content.

  .row
    .col-lg-6
      +jade
        :jadesrc
          //- layout.jade
          doctype html
          html
            head
              block title
                title Default title
            body
              block content
      +jade
        :jadesrc
          //- index.jade
          extends ./layout.jade

          block title
            title Article Title

          block content
            h1 My Article

    .col-lg-6
      +html
        :htmlsrc
          <!doctype html>
          <html>
            <head>
              <title>Article Title</title>
            </head>
            <body>
              <h1>My Article</h1>
            </body>
          </html>

  .panel.panel-info
    .panel-heading Note
    .panel-body.
      You can have multiple levels of inheritance, allowing you to create
      powerful higherachies of templates.