"Unexpected identifier" when adding extends / block to wintersmith-jade content file

I am making a static website using Wintersmith along with wintersmith-stylus and wintersmith-jade .

I want to add a specific CSS file to the help page. The help page is based on the layout template. When I try to use a block to insert a stylesheet into the html head, I get the following error:

Line ##: Unexpected identifier

      

layout.jade

doctype html
html
    head
        block head
        link(rel="stylesheet" href="/styles/layout.css")
    body

...

      

help.jade

---
template: layout.jade
---

//- Error inducing code
extends ./layout.jade

block head
    link(rel="stylesheet" type="text/css" href="../styles/help.css")
//- end of error inducing code

...

      

Even if I move the lines extends

and block head

on top of the containing metadata block template: layout.jade

, I still get the same error. The deletion extends ./layout.jade

causes the position of the error lines to move from 40 to 5 in my case.

My guess is that the error is caused by the wintersmith-jade plugin, but even if in this case, I am lost on how I will fix it.

+3


source to share


2 answers


Since I wanted to use both Stylus and Jade (with Jade for content and templates), I switched to Harp , Harp not only has a stylus and jade "built in" but is a little simpler than Wintersmith.



This is a pretty workaround, but I would say it is actually an update at the same time.

+2


source


I'm not using wintersmith-jade, but it looks like this plugin shouldn't affect normal templates in /templates

(which I think you mean).

Looking at templates/article.jade

, it looks like you should only use extends layout

instead extends ./layout.jade

.



The default templates also do not have a metadata block, but this may be necessary for the plugin you are using.

0


source







All Articles