-
Notifications
You must be signed in to change notification settings - Fork 342
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Alternatively accept _data.js
for metadata instead of plain JSON?
#103
Comments
yep, makes sense. (and agreed)
I think what you are wanting to do is possible by using harp as a library IN you pre-compile script. LIke so... note If you put your script in the base of your app I would suggest making sure you are running in "framework mode" meaning you have a yourproject/compile.js
Then you would build it by running We put our APIs through a lot of scrutiny so I wouldn't likely take a pull request that has an API that hasn't been put through its paces but we could start with a gist and go from there. |
Thanks for the quick & detailed response. I've seen that JSON-or-JS config pattern used elsewhere too (no ref I remember now sorry) and it's definitely easier in this case than using harp as a lib, so we'll be very glad if you consider it. Issue added to terraform (with gist): sintaxi/terraform#8. |
👍 |
Our problem is, we need to make data in external JSON files (originating from elsewhere) available to Jade templates. (A reasonable use case I think.)
Right now it doesn't look possible within Harp (I would probably write a "pre-Harp" build step generating the ad-hoc
_data.json
files). The best way I see would be that we can optionally replace the_data.json
with a_data.js
, in which we'd load the external files withrequire()
(and more generally do any simple preprocessing we need). Would that fit? If yes I'll be happy to submit the simple PR, if not alternative suggestions are welcome.The text was updated successfully, but these errors were encountered: