0.0.1-beta.1 • Published 4 years ago

gatsby-transformer-liist v0.0.1-beta.1

Weekly downloads
4
License
MIT
Repository
github
Last release
4 years ago

gatsby-transformer-liist

npm package Maintainability Dependabot

A Gatsby transformer to convert spreadsheet nodes into resources and content for Liist sites.


Install

Manual

  1. Install gatsby-transformer-liist

    npm install --save gatsby-transformer-liist

  2. Add plugin to gatsby-config.js

    // In your gatsby-config.js
     module.exports = {
       plugins: [
         {
         resolve: `gatsby-transformer-liist`,
         options: {
           types: [...]
       ],
     };

How to use

Options

OptionExplanation
typesAn array of node types
types.nodeTypeThe type of node that creates this child node
types.dynamicTypesWhether the type for each node is dynamic
types.definitionA 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.

License

MIT © Aquil.io