A simple Ruby Gem to bootstrap dependencies for setting up and maintaining a local Jekyll environment in sync with GitHub Pages
Перейти к файлу
Parker Moore 8160b2e250 Merge branch 'master' into ruby-2-3-1 2016-10-28 15:43:56 -07:00
bin Merge branch 'master' into version-config 2016-02-17 14:56:57 -05:00
lib Bump 💎 to v100 2016-10-28 15:20:25 -07:00
script Fix oneline log format in script/bump 2016-09-21 15:34:29 -07:00
spec Fix rubocop complaint about Fixnum vs Integer. 2016-09-21 15:47:50 -07:00
.gitignore dont git ignore script/test-site 2016-08-03 11:06:01 -04:00
.rspec Simplify configuration mashing. 2016-03-16 14:10:53 -07:00
.rubocop.yml Exclude spec/* and the gemspec from Metrics/BlockLength 2016-10-28 15:34:30 -07:00
.ruby-version Use Ruby 2.3.1 2016-10-28 15:28:44 -07:00
.travis.yml use 2.3.1 for 2.3 test on travis 2016-10-28 15:36:35 -07:00
CONTRIBUTING.md add an intro 2016-02-24 13:13:02 -05:00
Gemfile use proper version of malicious plugin from rubygems 2016-03-25 14:52:45 -04:00
ISSUE_TEMPLATE.md Update ISSUE_TEMPLATE.md 2016-10-22 07:44:39 -04:00
LICENSE move ©️ to GitHub 2013-08-08 12:30:10 -04:00
README.md document how to use the disable_whitelist flag 2016-03-25 14:58:37 -04:00
github-pages.gemspec use proper version of malicious plugin from rubygems 2016-03-25 14:52:45 -04:00

README.md

GitHub Pages Ruby Gem

A simple Ruby Gem to bootstrap dependencies for setting up and maintaining a local Jekyll environment in sync with GitHub Pages.

Gem Version Build Status

Usage

  1. Add the following to your project's Gemfile:
gem 'github-pages', group: :jekyll_plugins
  1. Run bundle install

Note: You are not required to install Jekyll separately. Once the github-pages gem is installed, you can build your site using jekyll build, or preview your site using jekyll serve. For more information about installing Jekyll locally, please see the GitHub Help docs on the matter.

Command line usage

The GitHub Pages gem also comes with several command-line tools, contained within the github-pages command.

List dependency versions

$ github-pages versions
+---------------------------+---------+
| Gem                       | Version |
+---------------------------+---------+
| jekyll                    | 3.0.2   |
| jekyll-sass-converter     | 1.3.0   |
| jekyll-textile-converter  | 0.1.0   |
| kramdown                  | 1.9.0   |
| rdiscount                 | 2.1.8   |
| ....                      | .....   |
+---------------------------+---------+

Note, you can also pass the --gemfile flag to get the dependencies listed in a valid Gemfile dependency format. You can also see a list of the live dependency versions at pages.github.com/versions.

Health check

Checks your GitHub Pages site for common DNS configuration issues.

$ github-pages health-check
Checking domain foo.invalid...
Uh oh. Looks like something's fishy: A record points to deprecated IP address

See the GitHub Pages Health Check documentation for more information.

Bypassing the plugin whitelist

If you'd like to run a Jekyll plugin locally that's not whitelisted for use on GitHub Pages, you can do so by prefixing the jekyll build or jekyll serve command with DISABLE_WHITELIST=true. This will allow your site to use any plugin listed in your site's gems configuration flag. Please note, however, this option is only available when previewing your Jekyll site locally.

Updating

To update to the latest version of Jekyll and associated dependencies, simply run gem update github-pages, or if you've installed via Bundler, bundle update github-pages.

Project Goals

The goal of the GitHub Pages gem is to help GitHub Pages users bootstrap and maintain a Jekyll build environment that most closely matches the GitHub pages build environment. The GitHub Pages gem relies on explicit requirements shared between both users' computers and the build servers to ensure that the result of a user's local build is consistently also the result of the server's build.

Additional tools, such as tools that integrate with the GitHub API to make managing GitHub Pages sites easier are not the primary goal, but may be within the project's scope.

What's versioned

The GitHub Pages gem seeks to version two aspects of the build environment:

1. Ruby

The version of Ruby with which Jekyll is executed. Although Jekyll itself may be compatible with prior or future versions of Ruby, different execution environments yield different results. Ruby 1.8.7 parses YAML differently than 1.9.3, for example, and Kramdown has trouble processing mailto links prior to 1.9.3. In order to ensure that building locally consistently results in the same build as what appears when published, it's essential that Ruby itself is versioned along side the Gem, despite no known incompatibilities.

Note: If you're using rbenv, check out ruby-build-github for ruby-build, a collection of GitHub-shipped Ruby versions. If you clone down this repository and run ./install.sh support/2.1.0-github, it should install properly for you.

2. Dependencies

This includes Markdown processors, and any other Jekyll dependency for which version incongruency may produce unexpected results. Traditionally, Maruku, Kramdown, RedCloth, liquid, rdiscount, and redcarpet have been strictly maintained due to known breaking changes.

Changelog

See all releases.

Releasing

To release a new version of this gem, run script/release from the master branch.

License

Distributed under the MIT License.