Skip to content

Consistent way to access view inside Nunjucks Tag #14

@dtothefp

Description

@dtothefp

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions