Description

Generate pages from JSON files using series of templates

Dependencies (optional)

Gatsby

How to install

Gatsby documentation uses yarn add gatsby-plugin-generate-pages for installation.

in gatsby-config add plugin and options { resolve: gatsby-plugin-generate-pages, options: { data: ${__dirname}/src/data/json, pages: [{ useTemplate: ${__dirname}/src/templates/SEM/index.js, // Use this template useJson: “atttv-bundle-packages”, // JS File with JSON uuid: “atttv-bundle-packages”, // UUID used to target if need be type: “has”, exportPath: /has/atttv-bundle-packages/, // Exports as index to this path under pages }] }, },

Available options (if any)

options: { data: ${__dirname}/src/data/json, // directory for JSON files pages: [{ useTemplate: ${__dirname}/src/templates/template1/index.js, // Use this template useJson: JSON file name, // use JSON file name from directory uuid: UUID, // UUID used to target if need be type: TYPE, // type for additional grouping identifier exportPath: EXPORTED PATH TO PAGES, // Exports as index to this path under pages }] },

When do I use this plugin?

For duplicating of pages, or archiving of pages that no longer need updates. We currently generate 50+ SEM pages, this allows for the programatic generation of these pages, as well as the duplciation of pages into other variations