edmellum / browserijade

A Browserify middleware that pre-compiles Jade templates on the server and uses the light-weight Jade runtime made for the browser to render them on the client.
21 stars 6 forks source link

add partial support #5

Closed tomjack closed 12 years ago

tomjack commented 12 years ago

This allows one to do != partial('foo'). It's relative to the template in which one calls partial.

edmellum commented 12 years ago

Just added support for Jade's template inheritance. Does that work for you?

tomjack commented 12 years ago

Yes, this looks like it will work.

However, to me, template inheritance doesn't seem like a good replacement for partials, because you have to go look for files which reference the file you're in, instead of just looking at the partials you reference in that file. Template inheritance seems useful for those rare situations where partials aren't enough, but partials are easier to reason about and debug for the simple cases.

I can always wrap renderFile with my own function that adds whatever extra helpers I want.