visionmedia/jade — Issue #377: extends doesnt work with express .render()?
Author: constantx
Created: 2011-10-18 04:58:00+00:00
State: open

I have 3 files:

layout.jade:

```javascript
html
head
title= title
body
block mainHeader

block mainContent

block mainFooter
#mainFooter.
footer here
```

and index.jade:

```javascript
extends layout

block mainContent
#mainContent.
mainContent here
```

app.js has this:

```javascript
app.get('/', function(req, res, next){
res.render('index',{
title: 'example site'
});
});
```

expres render index page but the block "mainContent" is not there at all. Extends doesnt seems to work. When I use jade's own .compile() and return the resulting fn(), extends works just fine. So how how can I get express to render index page properly, or do I have to use jade's .compile() way?