docpad-plugin-jade icon indicating copy to clipboard operation
docpad-plugin-jade copied to clipboard

One Jade scope for layouts and documents

Open kizu opened this issue 12 years ago • 7 comments

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.

kizu avatar Nov 17 '12 21:11 kizu

+1

darky avatar Dec 03 '12 12:12 darky

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 :)

balupton avatar Dec 03 '12 12:12 balupton

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.

kizu avatar Dec 03 '12 13:12 kizu

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.

darky avatar Dec 03 '12 13:12 darky

+1

Please do something, that's annoying problem

rooc avatar Jul 14 '13 12:07 rooc

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

balupton avatar Jul 14 '13 14:07 balupton

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

timaschew avatar Jan 10 '14 11:01 timaschew