Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

One Jade scope for layouts and documents #1

Open
kizu opened this issue Nov 17, 2012 · 7 comments
Open

One Jade scope for layouts and documents #1

kizu opened this issue Nov 17, 2012 · 7 comments

Comments

@kizu
Copy link
Contributor

kizu commented Nov 17, 2012

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
Copy link

darky commented Dec 3, 2012

+1

@balupton
Copy link
Member

balupton commented Dec 3, 2012

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
Copy link
Contributor Author

kizu commented Dec 3, 2012

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
Copy link

darky commented Dec 3, 2012

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
Copy link

rooc commented Jul 14, 2013

+1

Please do something, that's annoying problem

@balupton
Copy link
Member

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

@timaschew
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants