grunt-ejs-static icon indicating copy to clipboard operation
grunt-ejs-static copied to clipboard

path_to_data to accept array of strings inside Gruntfile too?

Open scottlet opened this issue 11 years ago • 2 comments

I would love for the path_to_data option to be able to accept an array of strings as well as a string as it can inside of the data.json files. I'm trying to build an i18n enabled website and want to be able to run this inside of a Grunt custom task to loop through and build separate templates from a single source with multiple languages, eg: path_to_data: ['json/site.json', 'json/i18n/en.json'], path_to_data: ['json/site.json', 'json/i18n/de.json']

etc.

What do you think of this idea? If you like it, I'll happily fork this and provide a pull request if needed :)

scottlet avatar Sep 10 '13 08:09 scottlet

This would be awesome feature to integrate. Took a quick look at your fork, looks really good. I'm pretty busy this week, but will have time over the weekend to work on this project. Thanks for forking, hadn't thought of integrating internationalization. Great idea!

shaekuronen avatar Sep 11 '13 17:09 shaekuronen

Cool :) I'm also modifying the thing to take globals direct from within grunt - not sure if it'd be that useful to anyone else, but I'm using it to build in versioning of static resources. global: { staticPath: '<%= yeoman.staticPath %>' } My static path is '$foo', which at build time in our CI environment is swapped for '1.0.', meaning each release has a different path for static resources. Then in apache I can set all css/js/images to be cacheable for 1+ years and not worry about stale stuff being accidentally served.

scottlet avatar Sep 22 '13 09:09 scottlet