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

Block inside attributes #1921

Open
ghost opened this issue Apr 4, 2015 · 4 comments
Open

Block inside attributes #1921

ghost opened this issue Apr 4, 2015 · 4 comments

Comments

@ghost
Copy link

ghost commented Apr 4, 2015

Hi,

is it possible to declare "block" inside an attribute?

E.g. meta( name='description' content='block descr' )

Or another elegant solution to inject content into attributes of templates?

@TimothyGu
Copy link
Member

Are you using mixins or extends?

@ghost
Copy link
Author

ghost commented Apr 5, 2015

Extends.

@ForbesLindesay
Copy link
Member

Not currently, It's an interesting idea that might not be totally impossible in v2. What you can do currently is something like:

block variables
  - var descr = 'default description';
meta(name='description' content=descr)

Then in the child template:

extends ./layout.jade

block variables
  - var descr = 'my description';

@ghost
Copy link
Author

ghost commented Apr 7, 2015

Nice workaround.

I tried variables before but forgot to declare it inside block.

Thank you!

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

No branches or pull requests

2 participants