File: includes.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 (133 lines) | stat: -rw-r--r-- 3,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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
extends ../reference.jade

block documentation
  h1 Includes

  p Includes allow you to insert the contents of one jade file into another.

  .row
    .col-lg-6
      +jade
        :jadesrc
          //- index.jade
          doctype html
          html
            include ./includes/head.jade
            body
              h1 My Site
              p Welcome to my super lame site.
              include ./includes/foot.jade
      +jade
        :jadesrc
          //- includes/head.jade
          head
            title My Site
            script(src='/javascripts/jquery.js')
            script(src='/javascripts/app.js')

      +jade
        :jadesrc
          //- includes/foot.jade
          #footer
            p Copyright (c) foobar
    .col-lg-6
      +html
        :htmlsrc
          <!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>
  h2 Including Plain Text

  p Including files that are not jade just includes the raw text.

  .row
    .col-lg-6
      +jade
        :jadesrc
          //- index.jade
          doctype html
          html
            head
              style
                include style.css
            body
              h1 My Site
              p Welcome to my super lame site.
              script
                include script.js
      +jade
        :csssrc
          /* style.css */
          h1 { color: red; }

      +jade
        :jssrc
          // script.js
          console.log('You are awesome');
    .col-lg-6
      +html
        :htmlsrc
          <!doctype html>
          <html>
            <head>
              <style>
                /* style.css */
                h1 { color: red; }
              </style>
            </head>
            <body>
              <h1>My Site</h1>
              <p>Welcome to my super lame site.</p>
              <script>
                // script.js
                console.log('You are awesome');
              </script>
            </body>
          </html>

  h2 Including Filtered Text

  p You can combine filters with includes to filter things as you include them.

  .row
    .col-lg-6
      +jade
        :jadesrc
          //- index.jade
          doctype html
          html
            head
              title An Article
            body
              include:markdown article.md
      +jade
        :verbatim
          # article.md

          This is an article written in markdown.

    .col-lg-6
      +html
        :htmlsrc
          <!doctype html>
          <html>
            <head>
              <title>An Article</title>
            </head>
            <body>
              <h1>article.md</h1>
              <p>This is an article written in markdown.</p>
            </body>
          </html>