Skip to content

Commit d966ac6

Browse files
authored
Merge pull request #781 from github/revert-to-gem-based-themes
Roll back remote themes for gem-based themes
2 parents 17e1f80 + 0a269c2 commit d966ac6

File tree

7 files changed

+22
-27
lines changed

7 files changed

+22
-27
lines changed

lib/github-pages/configuration.rb

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -159,12 +159,7 @@ def restrict_and_config_markdown_processor(config)
159159

160160
# If the user has set a 'theme', then see if we can automatically use remote theme instead.
161161
def migrate_theme_to_remote_theme(config)
162-
return unless config["theme"]
163-
return unless GitHubPages::Plugins::THEMES_TO_CONVERT_TO_REMOTE_THEMES.key?(config["theme"])
164-
165-
theme_name = config.delete("theme")
166-
config["remote_theme"] ||= GitHubPages::Plugins::THEMES_TO_CONVERT_TO_REMOTE_THEMES[theme_name]
167-
config["plugins"] = Array(config["plugins"]).concat(["jekyll-remote-theme"]).uniq
162+
# This functionality has been rolled back due to complications with jekyll-remote-theme.
168163
end
169164

170165
# If the user's 'exclude' config is the default, also exclude the CNAME

lib/github-pages/plugins.rb

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,20 @@ class Plugins
4949
# Themes
5050
THEMES = {
5151
"minima" => "2.5.1",
52+
"jekyll-swiss" => "1.0.0",
53+
"jekyll-theme-primer" => "0.6.0",
54+
"jekyll-theme-architect" => "0.2.0",
55+
"jekyll-theme-cayman" => "0.2.0",
56+
"jekyll-theme-dinky" => "0.2.0",
57+
"jekyll-theme-hacker" => "0.2.0",
58+
"jekyll-theme-leap-day" => "0.2.0",
59+
"jekyll-theme-merlot" => "0.2.0",
60+
"jekyll-theme-midnight" => "0.2.0",
61+
"jekyll-theme-minimal" => "0.2.0",
62+
"jekyll-theme-modernist" => "0.2.0",
63+
"jekyll-theme-slate" => "0.2.0",
64+
"jekyll-theme-tactile" => "0.2.0",
65+
"jekyll-theme-time-machine" => "0.2.0",
5266
}.freeze
5367

5468
# Themes to convert to remote themes

spec/github-pages/configuration_spec.rb

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
ENV.delete("DISABLE_WHITELIST")
2121
ENV["JEKYLL_ENV"] = "test"
2222
ENV["PAGES_REPO_NWO"] = "github/pages-gem"
23-
stub_request_for_remote_theme(:repo => "pages-themes/primer", :revision => "v0.6.0", :filename => "primer-0.6.0.zip")
2423
end
2524

2625
context "#effective_config" do
@@ -104,10 +103,9 @@
104103
context "themes" do
105104
context "with no theme set" do
106105
it "sets the theme" do
107-
expect(effective_config["plugins"]).to include("jekyll-remote-theme")
108106
expect(site.theme).to_not be_nil
109107
expect(site.theme).to be_a(Jekyll::Theme)
110-
expect(site.theme.name).to eql("primer")
108+
expect(site.theme.name).to eql("jekyll-theme-primer")
111109
end
112110
end
113111

@@ -120,16 +118,10 @@
120118
)
121119
end
122120

123-
before(:each) do
124-
stub_request_for_remote_theme(:repo => "pages-themes/merlot", :revision => "v0.2.0", :filename => "merlot-0.2.0.zip")
125-
end
126-
127121
it "respects the theme" do
128-
expect(configuration["theme"]).to be_nil
129-
expect(configuration["remote_theme"]).to eq(GitHubPages::Plugins::THEMES_TO_CONVERT_TO_REMOTE_THEMES["jekyll-theme-merlot"])
130122
expect(site.theme).to_not be_nil
131123
expect(site.theme).to be_a(Jekyll::Theme)
132-
expect(site.theme.name).to eql("merlot")
124+
expect(site.theme.name).to eql("jekyll-theme-merlot")
133125
end
134126
end
135127

@@ -144,6 +136,10 @@
144136
end
145137
end
146138

139+
it "plugins don't include jekyll remote theme" do
140+
expect(effective_config["plugins"]).to_not include("jekyll-remote-theme")
141+
end
142+
147143
context "with a remote theme" do
148144
let(:test_config) do
149145
{
@@ -156,7 +152,6 @@
156152
end
157153

158154
it "plugins include jekyll remote theme" do
159-
stub_request_for_remote_theme(:repo => "foo/bar", :revision => "HEAD", :filename => "primer-0.6.0.zip")
160155
expect(effective_config["plugins"]).to include("jekyll-remote-theme")
161156
end
162157
end

spec/github-pages/integration_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ def rm_destination
258258

259259
context "jekyll-theme-primer" do
260260
it "sets the theme" do
261-
expect(contents).to match("Theme: primer")
261+
expect(contents).to match("Theme: jekyll-theme-primer")
262262
end
263263

264264
it "uses the theme" do

spec/spec_helper.rb

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,6 @@ def tmp_dir
2929
File.expand_path "../tmp", __dir__
3030
end
3131

32-
def support_dir
33-
File.expand_path "support", __dir__
34-
end
35-
36-
def stub_request_for_remote_theme(repo:, revision:, filename:)
37-
stub_request(:get, "https://codeload.github.com/#{repo}/zip/#{revision}").
38-
to_return(:status => 200, :body => File.binread(File.join(support_dir, filename)), :headers => {"Content-Type" => "archive/zip"})
39-
end
40-
4132
RSpec::Matchers.define :be_an_existing_file do
4233
match { |path| File.exist?(path) }
4334
end

spec/support/merlot-0.2.0.zip

-460 KB
Binary file not shown.

spec/support/primer-0.6.0.zip

-69.1 KB
Binary file not shown.

0 commit comments

Comments
 (0)