0

保持したい 1 ページの Web サイトがありますが、個々のセクションを独立したページとして表示する必要もあります。私はノードでジェイドを使用していますが、ファイル/ブロックを含め始めるまで、すべてが正常に機能しています。

base.jade

!!! 5
  head
  body
    .nav
      // menu
    block content

index.jade

extends layout/base

block content
  p
   | This is the index page.
  include about

翡翠について

extends layout/base

block content
  p
   | This is the about page.

私がやろうとしているのは、インデックス ページを使用してすべてのページを表示し、個々のページでbase.jadeファイルを拡張することです。何が起こっているかというと、2 回index.jade拡張しているため、複数のナビゲーション バーが表示されています。base.jade私は少し立ち往生していて、ここで単純なものが欠けているように感じます。

どんな助けでも大歓迎です、ありがとう。

4

1 に答える 1

1

含めるファイルには、次のようなコンテンツ部分のみを含める必要があります

about-content.jade

p
   | This is the something about the site.

次にindex.jadeは

extends layout/base

block content
  p
   | This is the index page.
  include about-content

と about.jade

extends layout/base

block content
  p
   | This is the about page.
  include about-content
于 2013-02-05T22:18:41.723 に答える