foundation / panini

A super simple flat file generator.
Other
592 stars 104 forks source link

Exclude .js files from Panini’s data processing? #218

Closed Lohdro closed 4 years ago

Lohdro commented 4 years ago

I have source files in my project organized per-component instead of per-filetype, like so:

components/
  slideshow/
    slideshow.hbs
    slideshow.js
    slideshow.json

I'm passing the slideshow directory in Panini's data option so that it can pick up the slideshow.json file. Is there a way to exclude the .js file from being captured in Panini’s loadData method? It’s not intended to be used as handlebars data, and I’m getting a build error when Panini requires javascript dependencies in that file that aren’t intended to be loaded during the handlebars processing.

I’m able to work around this by separating the .json file into its own directory and passing that directory to Panini, but I’d like to avoid breaking up the above structure if possible.

DanielRuf commented 4 years ago

You could create another helper method with the same code but adjust the glob pattern there or change that in your forked and customized panini version:

https://github.com/foundation/panini/blob/a9b98c84943549d9d27afa6725d43838fb489838/lib/loadData.js#L11

joeworkman commented 4 years ago

This issue has been mentioned on Foundation Open Source Community. There might be relevant details there:

https://foundation.discourse.group/t/exclude-js-files-from-paninis-data-processing/2763/2