jstransformers / jstransformer-twig

Twig.js support for JSTransformers.
http://npm.im/jstransformer-twig
MIT License
2 stars 3 forks source link

Make it possible to pass a file reference for data #5

Open thiagodemellobueno opened 8 years ago

thiagodemellobueno commented 8 years ago

Would be very nifty if the render function could take a "jsonPath" option. something like return template.render.bind(template, getJSONFromFile(options.jsonPath))

RobLoach commented 8 years ago

Ah, like retrieve some extra options from some given .json file? Interesting idea. This could be something we put in where the Twig template is built. Usually it takes it from YAML front-matter, but we could do something like have it be a Twig function that expands the local variable table.

Or something... We'll need to do some thinking.

thiagodemellobueno commented 7 years ago

since kss uses the jsons, we probably want to use the same files. but seems acheivable!