Giter VIP home page Giter VIP logo

gatsby-source-github's Introduction

gatsby-source-github

Source plugin for pulling data into Gatsby from Github repositories. Works with gatsby-transform-remark if you like to pull markdown files from your repository.

Supports

  • Pulling trees / files from Github repositories
  • Pulling release information from Github repositories

How to use

NPM package

This package is available on npm as "@mosch/gatsby-source-github".

yarn add @mosch/gatsby-source-github

Gatsby Configuration

// In your gatsby-config.js
module.exports = {
  plugins: [
    {
      resolve: `@mosch/gatsby-source-github`,
      options: {           
        repository: "YOUR_REPOSITORY",
        tree: true,
        releases: true,
        user: "YOUR_USER",
        secrets: {
          token: "YOUR_API_TOKEN",
        }
      }
    }
  ],
}

Plugin options

  • tree: Pulls in the Github tree (all files) as GithubFiles (default false)
  • releases: Pulls in the Github releases as GithubReleases (default false)

How to query Files using GraphQL

A a sample query for fetching all File nodes.

query GithubFileQuery {
  allGithubFile {
    edges {
      node {
        repository
        user
        path
      }
    }
  }
}

How to query Releases using GraphQL

A a sample query for fetching all Release nodes.

query GithubReleasesQuery {
  allGithubReleases {
    edges {
      node {
        user
        repository
        version
        description
      }
    }
  }
}

gatsby-source-github's People

Contributors

mosch avatar michaelmure avatar renovate-bot avatar renovate[bot] avatar

Watchers

James Cloos 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.