1
注意:类似于this的问题,但不一样。Jade意外的块错误
我有一个expressjs节点网站(WIP),但我不断收到follwoing错误:
Warning: Unexpected block "head" on line 3 of \src\dynamic\views\index.jade. This block is never used. This warning will be an error in v2.0.0 Warning: Unexpected block "body" on line 5 of \src\dynamic\views\index.jade. This block is never used. This warning will be an error in v2.0.0
我src\dynamic\views\index.jade
:
extends _includes/head/head block head title Skool - On Our Way! block body extends _includes/navbars/topNav
的_includes/navbars/topNav.jade
文件只是一个基本的玉文件描述一个简单的bootstrap导航栏,所以我会省略它。
_includes/head/head
:
doctype html html head link(rel="styleSheet" href="css/main.css") script(src="js/app.js") block head body block body
现在,当我访问localhost:3000
,我招呼着我的编译玉文件,除了<head>
元素是空的,所以有没有CSS联系!检查控制台日志我看到前面提到的错误/警告。
我在做什么错?
我认为你应该只在你的视图中使用** extends **。使用** include ** for topNav – Molda
谢谢。不知道有一个包含声明。 –