2017-06-16 61 views
0

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,我看到

enter image description here

哪些meand追加不會呈現。

爲什麼?

回答

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") 
    ...