Skip to content

Source plugin for pulling data into Gatsby from Are.na

Notifications You must be signed in to change notification settings

aredotna/gatsby-source-are.na

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gatsby-source-are.na

Source plugin for pulling data into gatsby from are.na.

Check out the examples in the /examples folder for how this plugin could be used as a lightweight CMS for a image board or portfolio.

This plugin also transforms images so you can use with gatsby-image.

Installation

npm install --save gatsby-source-are.na

or

yarn add gatsby-source-are.na

Requirements

You will first need to generate an access token from dev.are.na which will be passed into via gatsby-config.js.

How to use

You will need to pass in a valid accessToken and a list of channels by their slug to channelSlugs.

// In your  gatsby-config.js
plugins: [
  {
    resolve: 'gatsby-source-are.na',
    options: {
      accessToken: 'xxxx',
      channelSlugs: ['slug-1', 'slug-2'],
    }
  },
]

Querying Data

Query all channels passed in via channelSlugs.

{
  allArenaChannels {
    edges {
      node {
      slug
      children {
        __typename
        ... on ArenaInnerChannel {
          title
          slug
          children {
            __typename
            ... on ArenaBlock {
              title
              image {
                childImageSharp {
                  fluid(maxWidth: 1280) {
                    ...GatsbyImageSharpFluid_noBase64
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}

Query a specific channel

{
  arenaChannel(slug: { eq: "some-slug" }) {
    title
  }
}

Query a specific inner channel

{
  arenaInnerChannel(slug: { eq: "some-slug" }) {
    title
  }
}

About

Source plugin for pulling data into Gatsby from Are.na

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%