0.0.1-beta.1 • Published 4 years ago
gatsby-transformer-liist v0.0.1-beta.1
gatsby-transformer-liist
A Gatsby transformer to convert spreadsheet nodes into resources and content for Liist sites.
Install
Manual
Install
gatsby-transformer-liist
npm install --save gatsby-transformer-liist
Add plugin to
gatsby-config.js
// In your gatsby-config.js module.exports = { plugins: [ { resolve: `gatsby-transformer-liist`, options: { types: [...] ], };
How to use
Options
Option | Explanation |
---|---|
types | An array of node types |
types.nodeType | The type of node that creates this child node |
types.dynamicTypes | Whether the type for each node is dynamic |
types.definition | A GatsbyJS type builder object |
Definitions
Definitions are passed to Gatsby's schema.buildObjectType
. The Gatsby docs cover all the options available.
Images
Any field with a type of Image
will have it's type changed to File
and have a custom resolver function added that links to a FileNode
that is created from the url value.
Dynamic Types
Certain nodes can have their type determined by a type
field. These nodes will be created with a value
field of type LiistDynamicType
. The resulting node then becomes:
{
key: 'someKey',
value: {
type: 'Image',
raw: 'image.jpg',
value: {...} // childImageSharpNode
}
}
Changelog
See CHANGELOG.md.