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

Make possible to use interpolation in include`s filenames #569

Closed
iuriikomarov opened this issue Apr 3, 2012 · 3 comments
Closed

Make possible to use interpolation in include`s filenames #569

iuriikomarov opened this issue Apr 3, 2012 · 3 comments

Comments

@iuriikomarov
Copy link

Something like this:

each page in pages
..h1 #{page.title}
..include pages/#{page.source}.jade

@tj
Copy link
Contributor

tj commented Apr 3, 2012

includes are compile-time, sorry! maybe some day we'll have a runtime variant but for now it would be far too slow

@tj tj closed this as completed Apr 3, 2012
@Grawl
Copy link

Grawl commented Jul 28, 2013

Sad. Any workaround?

@ForbesLindesay
Copy link
Member

Option 1

Dynamically generate your jade file and then pass it to jade.render

Option 2

Do jade.renderFile('my-jade-file.jade', {renderFile: jade.renderFile}) then in your jade file:

!= renderFile(page.source, {page: page})

It's not quite the same as it's at runtime, so slow if not cached, and it requires you to explicitly pass any variables you want to be available.

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

4 participants