Express 未能扩展

Express 未能扩展,express,pug,Express,Pug,我无法使jade文件正确地相互扩展。这是我的index.jade文件: !!! 5 html(lang='en') head ... scripts and stuff here... body include navbar div.cont div#row-fluid a.slice#four(href="#fourbox") div.subwindow block blog 在同一目录中,

我无法使jade文件正确地相互扩展。这是我的index.jade文件:

!!! 5
html(lang='en')
  head
   ... scripts and stuff here...
  body
    include navbar
    div.cont
      div#row-fluid
        a.slice#four(href="#fourbox")
          div.subwindow
            block blog
在同一目录中,我有一个名为blog.jade的文件,其中包含以下代码:

extends index

block blog
  .container-fluid(style="height:100%;")
      body(style="margin:0px;padding:0px;overflow:hidden")
        iframe(src="http://website.com", frameborder="0", style="overflow:hidden;height:100%;width:100%", height="100%", width="100%")

当我在express中运行服务器时,会加载索引,但无法使用正确的内容填充#four。我在这段代码中做错了什么吗?

问题出在服务器端,因为您的jade看起来不错:

试试
app.get('/',…)

不是

p、 你有两个主体标记
body(style=“margin:0px;padding:0px;overflow:hidden”)
注意这里

如果您的索引始终包含博客文件:

尝试删除这些行@blog.jade

extends index

block blog
和change@index.jade

block blog ---> include blog

是的,就是那个渲染问题。我没有意识到这就是extend的工作方式。谢谢你的帮助!
extends index

block blog
block blog ---> include blog