Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/github/pages-gem
Browse files Browse the repository at this point in the history
# Conflicts:
#	lib/github-pages/version.rb
  • Loading branch information
sskylar committed Jul 20, 2017
2 parents 3da9082 + 9ae72e7 commit 4f64d2e
Show file tree
Hide file tree
Showing 8 changed files with 58 additions and 33 deletions.
20 changes: 1 addition & 19 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,7 @@ Hi there! We're glad you're interested in contributing to the GitHub Pages Gem.

## Where to get help or report an issue

### Bugs

* If your think you may have found a bug in a particular theme or plugin, please open an issue against that project's repository directly.

* If your think you may have found a bug in Jekyll itself, please [open an issue in the Jekyll repository](https://github.com/jekyll/jekyll/issues/new).

* If you think you may have found a bug with how the GitHub Pages Gem bootstraps your local development environment, please [open an issue in this repository](https://github.com/github/pages-gem/issues/new).

### Questions

If you have a general question about Jekyll or GitHub Pages (e.g., a configuration question, a question specific to your site, upgrading, etc.) you have two options:

1. [Contact GitHub Support](https://github.com/contact?form%5Bsubject%5D=GitHub%20Pages), or

2. Ask your question of the Jekyll community on [talk.jekyllrb.com](https://talk.jekyllrb.com/)

### Feature requests

General GitHub Pages feature requests, including requests to add additional plugins or themes should be made via [GitHub Support](https://github.com/contact?form%5Bsubject%5D=GitHub%20Pages%20Feature%20Request).
See [the support guidelines](SUPPORT.md)

## Contributing

Expand Down
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
### Before submitting an issue, please be sure to

- [ ] Read [the contributing instructions](https://github.com/github/pages-gem/blob/master/CONTRIBUTING.md#contributing-to-the-github-pages-gem)
- [ ] Read [the contributing instructions](https://github.com/github/pages-gem/blob/master/.github/CONTRIBUTING.md#contributing-to-the-github-pages-gem)
- [ ] Update to the latest Gem version (run `bundle update github-pages`)

### This issue affects

- [ ] The site generated by GitHub Pages
- [ ] Building sites locally

*The GitHub Pages Gem is intended to help users replicate the GitHub Pages build environment locally. If your issue affects both the hosted version and the version previewed locally, you may be better suited reporting [seeking support in other forums](https://github.com/github/pages-gem/blob/master/CONTRIBUTING.md#where-to-get-help-or-report-an-issue).*
*The GitHub Pages Gem is intended to help users replicate the GitHub Pages build environment locally. If your issue affects both the hosted version and the version previewed locally, you may be better suited reporting [seeking support in other forums](https://github.com/github/pages-gem/blob/master/.github/CONTRIBUTING.md#where-to-get-help-or-report-an-issue).*

### What did you do (e.g., steps to reproduce)

Expand Down
21 changes: 21 additions & 0 deletions .github/SUPPORT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
## Where to get help or report an issue

### Bugs

* If your think you may have found a bug in a particular theme or plugin, please open an issue against that project's repository directly.

* If your think you may have found a bug in Jekyll itself, please [open an issue in the Jekyll repository](https://github.com/jekyll/jekyll/issues/new).

* If you think you may have found a bug with how the GitHub Pages Gem bootstraps your local development environment, please [open an issue in this repository](https://github.com/github/pages-gem/issues/new).

### Questions

If you have a general question about Jekyll or GitHub Pages (e.g., a configuration question, a question specific to your site, upgrading, etc.) you have two options:

1. [Contact GitHub Support](https://github.com/contact?form%5Bsubject%5D=GitHub%20Pages), or

2. Ask your question of the Jekyll community on [talk.jekyllrb.com](https://talk.jekyllrb.com/)

### Feature requests

General GitHub Pages feature requests, including requests to add additional plugins or themes should be made via [GitHub Support](https://github.com/contact?form%5Bsubject%5D=GitHub%20Pages%20Feature%20Request).
18 changes: 12 additions & 6 deletions lib/github-pages/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,12 @@ class Configuration
},
}.freeze

# Jekyll defaults merged with Pages defaults.
MERGED_DEFAULTS = Jekyll::Utils.deep_merge_hashes(
Jekyll::Configuration::DEFAULTS,
DEFAULTS
).freeze
# User-overwritable defaults used only in production for practical reasons
PRODUCTION_DEFAULTS = Jekyll::Utils.deep_merge_hashes DEFAULTS, {
"sass" => {
"style" => "compressed",
},
}.freeze

# Options which GitHub Pages sets, regardless of the user-specified value
#
Expand Down Expand Up @@ -82,6 +83,11 @@ def development?
Jekyll.env == "development"
end

def defaults_for_env
defaults = development? ? DEFAULTS : PRODUCTION_DEFAULTS
Jekyll::Utils.deep_merge_hashes Jekyll::Configuration::DEFAULTS, defaults
end

# Given a user's config, determines the effective configuration by building a user
# configuration sandwhich with our overrides overriding the user's specified
# values which themselves override our defaults.
Expand All @@ -91,7 +97,7 @@ def development?
# Note: this is a highly modified version of Jekyll#configuration
def effective_config(user_config)
# Merge user config into defaults
config = Jekyll::Utils.deep_merge_hashes(MERGED_DEFAULTS, user_config)
config = Jekyll::Utils.deep_merge_hashes(defaults_for_env, user_config)
.fix_common_issues
.add_default_collections

Expand Down
8 changes: 4 additions & 4 deletions lib/github-pages/dependencies.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module GitHubPages
class Dependencies
VERSIONS = {
# Jekyll
"jekyll" => "3.4.3",
"jekyll" => "3.4.5",
"jekyll-sass-converter" => "1.5.0",

# Converters
Expand All @@ -17,7 +17,7 @@ class Dependencies
# Misc
"liquid" => "3.0.6",
"rouge" => "1.11.1",
"github-pages-health-check" => "1.3.4",
"github-pages-health-check" => "1.3.5",

# Plugins
"jekyll-redirect-from" => "0.12.1",
Expand All @@ -27,14 +27,14 @@ class Dependencies
"jekyll-paginate" => "1.1.0",
"jekyll-coffeescript" => "1.0.1",
"jekyll-seo-tag" => "2.2.3",
"jekyll-github-metadata" => "2.4.0",
"jekyll-github-metadata" => "2.5.1",
"jekyll-avatar" => "0.4.2",

# Plugins to match GitHub.com Markdown
"jemoji" => "0.8.0",
"jekyll-mentions" => "1.2.0",
"jekyll-relative-links" => "0.4.1",
"jekyll-optional-front-matter" => "0.1.2",
"jekyll-optional-front-matter" => "0.2.0",
"jekyll-readme-index" => "0.1.0",
"jekyll-default-layout" => "0.1.4",
"jekyll-titles-from-headings" => "0.2.0",
Expand Down
2 changes: 1 addition & 1 deletion lib/github-pages/plugins.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class Plugins
THEMES = {
"minima" => "2.1.1",
"jekyll-swiss" => "0.4.0",
"jekyll-theme-primer" => "0.2.1",
"jekyll-theme-primer" => "0.3.1",
"jekyll-theme-architect" => "0.0.4",
"jekyll-theme-cayman" => "0.0.4",
"jekyll-theme-dinky" => "0.0.4",
Expand Down
2 changes: 1 addition & 1 deletion lib/github-pages/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true
module GitHubPages
VERSION = 141
VERSION = 146
.to_s + '-siteleaf'.freeze
end
16 changes: 16 additions & 0 deletions spec/github-pages/configuration_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
let(:configuration) { Jekyll.configuration(test_config) }
let(:site) { Jekyll::Site.new(configuration) }
let(:effective_config) { described_class.effective_config(site.config) }
let(:defaults_for_env) { described_class.defaults_for_env }

before(:each) do
ENV.delete("DISABLE_WHITELIST")
ENV["JEKYLL_ENV"] = "test"
Expand Down Expand Up @@ -55,6 +57,15 @@
it "accepts local configs" do
expect(effective_config["testing"]).to eql("123")
end

context "in development" do
before { ENV["JEKYLL_ENV"] = "development" }

it "doesn't compress sass" do
expect(effective_config["sass"]).to be_nil
expect(defaults_for_env["sass"]).to be_nil
end
end
end

context "#set being called via the hook" do
Expand Down Expand Up @@ -159,6 +170,11 @@
expect(described_class.disable_whitelist?).to eql(false)
end
end

it "compresses sass" do
expect(effective_config["sass"]).to eql("style" => "compressed")
expect(defaults_for_env["sass"]).to eql("style" => "compressed")
end
end
end
end

0 comments on commit 4f64d2e

Please sign in to comment.