Skip to content
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

JSON file or CSV convert to multiple HTML files #83

Closed
webnet2 opened this issue Mar 30, 2016 · 9 comments
Closed

JSON file or CSV convert to multiple HTML files #83

webnet2 opened this issue Mar 30, 2016 · 9 comments

Comments

@webnet2
Copy link

webnet2 commented Mar 30, 2016

Can someone please show me how to generate a JSON or CSV file to multiple HTML files? Basically, I'm looking for each JSON object to be converted into a single HTML page (so if there are 50 objects then I will have 50 HTML files). Or each row into a single HTML file. I tried different scenarios but no luck.

@david-zacharias
Copy link
Collaborator

So you have an array of objects in your JSON data, right? I guess so.

Do you also want to have one main file that links to the generated files?

If yes, you can use the _bake-attribute for generating extra files from within the _foreach-loop in your main file for each object.

If not, you need to run bake for each file. Which is possible with the Grund-files syntax. The problem I see and you probably stumbled upon is how to tell bake which object to use for each file. Currently I see no way to do this, sorry. Maybe @MathiasPaumgarten can come up with a hack that will do the trick.

@webnet2
Copy link
Author

webnet2 commented Mar 30, 2016

I tried the _bake attribute but does not seem to work though. No pages were generated.

@david-zacharias
Copy link
Collaborator

How does your code look?

@webnet2
Copy link
Author

webnet2 commented Mar 31, 2016

I only tried to run the Simple bake to be sure it will generate a couple of html pages but it did not seem to work on my node.js - Here is the simple bake click here

@david-zacharias
Copy link
Collaborator

Without more information about your specific settings I can not provide more help. Simple bake (and all other features) run on my local configuration as well as on travis CI.

@webnet2
Copy link
Author

webnet2 commented Mar 31, 2016

I tried to run grunt-bake but it seemed like nothing happened. I need help please...
bake_test

@david-zacharias
Copy link
Collaborator

I get the feeling that you missed to read the basics of Grunt. So please take time to read the Getting Started guide. I will close your issue for now because it is not a feature request or bug report related to this project. Probably stackoverflow the better place to get help. But first, please read the guide.

@webnet2
Copy link
Author

webnet2 commented Mar 31, 2016

Okay. I got it working now! Thanks! :-)

@roboshoes
Copy link
Owner

Glad you guys could hash it out. As always @david-zacharias thanks for being so on top on responding to user issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants