-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Feature Request: Page collections #414
Comments
With the current Gatsby I'd suggest you maintain the data as you suggest and then auto-generate JSON files for each page and create a json wrapper component (like https://github.com/gatsbyjs/gatsby-starter-default/blob/master/wrappers/json.js) for the landing pages. For Gatsby 1.0 — read #420 and #421 — would love to hear your reaction to my ideas! |
Yes, I have the json wrapper :) Nice to know you are working on 1.0 |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been automatically closed due to inactivity. |
Briefing
My project has a big number of Landing pages for sales. One landing page per partner using the same template and changing only the variables.
But, it's a bit complicated. The landing pages change frequently.
Today I have a huge operational task to delete and create new .md files every time it is changed.
To handle that, before I started using Gatsby, we had a script that generate all the things we need in a single json file, a collection file. At that time I had written another script that generate all the pages using the template (gulp and handlebars were my friends).
Suggestion: theory
My suggestion is that it works:
pages/collection.json =>
Suggestion: implementation
I confess that I have not mastered the Gatsby code yet, despite having given a good study xD.
But I have a suggest of implementation of this: when Gatsby read the file and parse it, you can check if it's an array, then split in multiple pages. To deal with url resolver, if items not have a
path
, you can resolve it as/${filename}-${arrayOrder}/
:/collection-1/
,/collection-2/
, etc.The text was updated successfully, but these errors were encountered: