I’m using mustache partials for our internal documentation and for testing – as described in this other SO question how to have grunt task render mustache partials to static HTML, and I’d now like to make the partials data driven using external json files. The json files would be named the same as the partials and will contain mock data that would compile with the partials.
Any suggestions on how to get this working?
I’ve updated the hogan.js file to read in data.json files that have the same name as the partials:
A simple example of an alert.json file:
alert.mustache
alerts
I like this next example better because you can create different data to use
in the same partials:
alert.json
alert.mustache
partials.mustache — this is where the alert partial is referenced
Let me know if this helps.
Thanks,
Brian