Skip to content

Feature Request: Page collections #414

@renatorib

Description

@renatorib

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 =>

[
  {
    "title": "My phone page",
    "path": "/my-phone-page",
    "cta": "Call me maybe"
  },
  {
    "title": "My selling page",
    "path": "/my-selling-page",
    "cta": "Buy me, please"
  }
]

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    stale?Issue that may be closed soon due to the original author not responding any more.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions