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

Consistent way to access view inside Nunjucks Tag #14

Open
dtothefp opened this issue Jul 13, 2016 · 1 comment
Open

Consistent way to access view inside Nunjucks Tag #14

dtothefp opened this issue Jul 13, 2016 · 1 comment

Comments

@dtothefp
Copy link

As discussed here
#13
and here
jonschlinkert/templates#17

view on the file context is difficult in Nunjucks. A typical nunjucks tag can be constructed like so
https://mozilla.github.io/nunjucks/api.html#custom-tags
and you can see an example in my assemble sample repo
https://github.com/dtothefp/assemble-view-issue/blob/master/tags/debug.js

I was previously accessing view off of context.ctx in the Nunjucks tag, and you suggested I can access it in a helper using this.view but I don't know how this transfers into Nunjucks land

@assemblebot
Copy link

@dtothefp Thanks for the issue! If you're reporting a bug, please be sure to include:

  • The version of assemble you are using.
  • Your assemblefile.js (This can be in a gist)
  • The commandline output. (Screenshot or gist is fine)
  • What you expected to happen instead.

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

2 participants