gatsby-plugin-github-pages

1.0.1 • Public • Published

Gatsby Plugin GitHub Pages

JavaScript Style Guide npm version dependencies Status devDependencies Status
A Gatsby plugin that deploys your public folder to Github Pages on build.

With no configuration the destination is root to a gh-pages branch on the current repository.

The branch, directory, and repository my all be changed via the publishOptions config.

The Gatsby site in the example directory is hosted at https://rongierlach.github.io/gatsby-plugin-github-pages.

Install

$ npm install gatsby-plugin-github-pages

Usage

Place the plugin last in your plugins array.

User and Organization Pages

If you are using a custom domain for your page you must specify it in the gatsby-config.js file like so:

module.exports = {
  plugins: [
    /* other plugins */
    {
      resolve: 'gatsby-plugin-github-pages'
      options: {
        customDomain: 'mycustomdomain.com'
        publishOptions: {
          /* ... */
        }
      }
    }
  ]
}

Project Pages

You must build with the prefix-paths flag like so:
$ gatsby build --prefix-paths

You must also specify a pathPrefix in your gatsby-config.js file:

module.exports = {
  pathPrefix: '/name-of-your-repo',
  plugins: [
    /* other plugins */
    {
      resolve: 'gatsby-plugin-github-pages'
      options: {
        publishOptions: {
          /* ... */
        }
      }
    }
  ]
}

Publish Options

The plugin uses gh-pages internally, publish options can be found in greater detail here.

Readme

Keywords

none

Package Sidebar

Install

npm i gatsby-plugin-github-pages

Weekly Downloads

0

Version

1.0.1

License

GPL-3.0

Last publish

Collaborators

  • rongierlach