Load json for each template, partial

41 views
Skip to first unread message

in...@dotmagic.de

unread,
Jun 18, 2016, 3:54:48 PM6/18/16
to Nunjucks
I'm using nunjucks for a static site builder and like to have the functionality to load json data every time a template get loaded with include, extends.

Example:

Template:
src/components/list.njk

JSON:
src/components/list.json

Base Template:
{% include "list.njk" %}

I've played already with a custom FileSystemLoader but I dont know how to pass the the data only to the context of this template. Any suggestions?

Kind Regards
Werner
Reply all
Reply to author
Forward
0 new messages