关于node.js:Bootstrap呈现空白白页-Node JS- Express-Jade

Bootstrap rendering a blank white page - node js- express - jade

我正在尝试使Jade模板引擎的Node.js的引导程序正常工作。

当我尝试运行index.jade文件时,它仅呈现空白白页。

1
2
3
4
5
6
7
8
9
10
11
div.topbar
  div.fill
    div.container
      a.brand(href='#') #{title}
      ul.nav

      form.pull-right(method="post", id="loginForm")
        input.input-small(id="username", type="text", name="User", placeholder="Username")
        input.input-small(id="password", type="password", name="Password", placeholder="Password")
        input.btn.primary(type="submit", value="Sign In")
      p#loginPrompt.pull-right.login-prompt

运行此程序时,我会得到类似的内容。

enter image description here

但是当我尝试包括扩展布局(请参见下图)时,我定义了引导程序样式。
我得到一张空白页。
enter image description here

任何人都可以向我解释如何设置此引导程序工作。
我在public下的stylesheets文件夹中有bottstrap css文件,而在public文件夹中的javascripts下有js文件。

layout.jade

1
2
3
4
5
6
7
8
9
10
11
doctype
html
  head
    title= title
    link(rel='stylesheet', href='/stylesheets/bootstrap.min.css')
    link(rel='stylesheet', href='/stylesheets/bootstrap-responsive.min.css')
    link(rel='stylesheet', href='/stylesheets/style.css')
    script(src='http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js')
    script(src='/javascripts/bootstrap.min.js')
  body
    block content

确保像这样包含block content

1
2
3
4
5
6
7
8
9
10
11
12
13
extends ./layout.jade
block content
    div.topbar
      div.fill
        div.container
          a.brand(href='#') #{title}
          ul.nav

          form.pull-right(method="post", id="loginForm")
            input.input-small(id="username", type="text", name="User", placeholder="Username")
            input.input-small(id="password", type="password", name="Password", placeholder="Password")
            input.btn.primary(type="submit", value="Sign In")
          p#loginPrompt.pull-right.login-prompt

我测试了它是否可以与您显示的layout.jade一起使用。


尝试引用玉器布局时的简单错误。如果在这里不起作用,请使用extends./layout.jade,这是一个类似问题的链接。