docpad-archive / docpad-plugin-jade

Adds support for the Jade templating engine to DocPad.
Other
17 stars 8 forks source link

One Jade scope for layouts and documents #1

Open kizu opened 11 years ago

kizu commented 11 years ago

Is there any way to make the layouts and documents to be in one scope? So I could define Jade's mixins and variables in one layout file and then reuse them in the documents?

Right now I need to manually write the includes for my mixins.jade in every document and layout, and it's not fun.

darky commented 11 years ago

+1

balupton commented 11 years ago

Can you do up a mockup input and output of what you're after. I don't use jade myself, so not that familiar with its requirements. Hopefully we can get someone who uses jade to pimp out this plugin some more :)

kizu commented 11 years ago

If I have a layout, say, default.jade like this:

+foo
  .foo.bar
    block

Then I want to use it in about.html.jade:

---
layout: default
---

+foo
  baz

Right now there would be an error with undefined foo mixin, so we'd like to have all variables and mixins from layouts to be available in documents/nested layouts.

darky commented 11 years ago

Balupton, firstly read little about jade mixins: https://github.com/visionmedia/jade#a14

I say otherwise:

All mixins from documents/nested layouts should be available in layout, where you use:

{content} (Jade)

@content (Eco) e t. c.

rooc commented 11 years ago

+1

Please do something, that's annoying problem

balupton commented 11 years ago

Please submit a pull request, or add a bounty to inspire someone else to submit a pull request.

timaschew commented 10 years ago

+1 @darrrk you should use != instead of #{}