2017-06-16 1 views
0

Mein layout.jade folgt:append Kopf funktioniert nicht in 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 

Mein place.jade folgt:

extends layout 

append head 
    script(src="/javascripts/custom.js") 
    ... 

Als ich templete dienen, ich sehe

enter image description here

Welches meand and anfügen überhaupt nicht rendert.

Warum?

Antwort

2

Anfügen funktioniert nur mit Block so der richtige Code von layout.jade ist

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 

und für place.jade wird

extends layout 

append scripts 
    script(src="/javascripts/custom.js") 
    ... 
Verwandte Themen