Code Monkey home page Code Monkey logo

gatsby-source-imgur-albums's Introduction

Gatsby Source Imgur Albums Plugin

This Gatsby plugin allows to "source" Imgur albums into what Gatsby calls nodes.

Inspired by gatsby-imgur-gallery-albums which was unfortunately not updated in the last years.

Dependencies (optional)

This plugin was tested using the gatsby-plugin-image plugin.

How to install

npm add gatsby-source-imgur-albums

When do I use this plugin?

This plugin is useful if you want to add images from Imgur albums to your Gatsby site.

Examples of usage

The plugin is used in production at my portfolio website (source code).

Add the plugin into your site's gatsby-config.js file:

module.exports = {
  plugins: [
    {
      resolve: `gatsby-source-imgur-albums`,
      options: {
        clientId: "XXXXXX", // register a new app at https://api.imgur.com/oauth2/addclient and select "Anonymous usage without user authorization"
        albumHashes: ['abc', 'def'], // checkout https://dev.to/codingcoach/get-your-album-id-in-imgur-b6c to get the ID of your album
        debug: false, // if true, some debug messages are logged
        apiUrl: "https://...." // if not set, https://api.imgur.com/3/album/ is used per default
      },
    }
  ],
}

How to query for data

  {
    imgurAlbums: allImgurAlbum {
      nodes {
        title
        images_count
        images {
          localFile {
            childImageSharp {
              gatsbyImageData(width: 200)
            }
          }
        }
      }
    }
  }

gatsby-source-imgur-albums's People

Contributors

mokkapps avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.