porchdotcom / gatsby-source-gitlab-projects

Gatsby source plugin for fetching project metadata for projects in Gitlab.

Home Page:https://www.npmjs.com/package/@porch/gatsby-source-gitlab-projects

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

gatsby-source-gitlab-projects

Gatsby source plugin for fetching project metadata for projects in Gitlab.

Usage

npm install @porch/gatsby-source-gitlab-projects

Add the following to your gatsby-config.js:

module.exports = {
 plugins: [
    {
      resolve: '@porch/gatsby-source-gitlab-projects',
      options: {
        gitlab: {
          domain: 'your-gitlab-domain',
          privateToken: 'your-private-token',
        },
        includeReadme: true,
        searchParams: {
            // See https://docs.gitlab.com/ee/api/projects.html#list-all-projects
        },
        groupId: 1 // If provided, will fetch all projects for the given group, see https://docs.gitlab.com/ee/api/groups.html#list-a-groups-projects
      }
    }
};

Sample Gatsbys GraphQL query:

{
  allGitLabProject {
    edges {
      node {
        id
        project {
          name
          name_with_namespace
          description
          path
          web_url
          namespace {
            id
            name
          }
        }
      }
    }
  }
}

Read the Gatsby documentation for help on using GraphQL.

About

Gatsby source plugin for fetching project metadata for projects in Gitlab.

https://www.npmjs.com/package/@porch/gatsby-source-gitlab-projects

License:MIT License


Languages

Language:JavaScript 100.0%