I would like to use Jade block inheritance but I’m not sure how to do that if I’m not using Express. According to the Jade doc, I can use block inheritance in Express by simply adding app.set('view options', { layout: false });. How can I achieve this without Express?
I would like to use Jade block inheritance but I’m not sure how to
Share
You don’t need Express at all to use Jade’s Template inheritance; you only need Jade:
Another example can be found in the repository:
examples/extend.jsexamples/extend.jadeexamples/extend-layout.jade.The reason the Jade docs mention setting the
'view options'for Express 2.x is because Express’ own (and now defunct in 3.x) layouts are a competing feature that should be disabled to prevent conflicts when using Jade’s inheritance.