我的layout.jade
正在关注:
doctype html
html
head
title= title
link(rel='stylesheet', href='/stylesheets/style.css')
link(rel='stylesheet', href='/stylesheets/bootstrap.css')
link(rel='stylesheet', href='/stylesheets/bootstrap-grid.css')
link(rel='stylesheet', href='/stylesheets/bootstrap-reboot.css')
script(src="/javascripts/core.js")
script(src="/javascripts/jquery.js")
script(src="/javascripts/jquery-slim.js")
script(src="/javascripts/bootstrap.js")
body
block content
我的place.jade
正在关注:
extends layout
append head
script(src="/javascripts/custom.js")
...
当我为templete服务时,我看到了
哪个meand追加都没有呈现。
为什么?
答案 0 :(得分:2)
追加仅适用于块,因此layout.jade的正确代码为
doctype html
html
head
block scripts
title= title
link(rel='stylesheet', href='/stylesheets/style.css')
link(rel='stylesheet', href='/stylesheets/bootstrap.css')
link(rel='stylesheet', href='/stylesheets/bootstrap-grid.css')
link(rel='stylesheet', href='/stylesheets/bootstrap-reboot.css')
script(src="/javascripts/core.js")
script(src="/javascripts/jquery.js")
script(src="/javascripts/jquery-slim.js")
script(src="/javascripts/bootstrap.js")
body
block content
并且对于place.jade将是
extends layout
append scripts
script(src="/javascripts/custom.js")
...