Skip to content

Commit 92d34b8

Browse files
committed
fix(gh-pages): Allow gh-pages to load files from remote themes
1 parent ae69de4 commit 92d34b8

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

lib/jekyll/algolia/overwrites/githubpages-configuration.rb

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,23 @@ module GitHubPages
1010
# github-pages gem installed at the same time, those hooks will never be
1111
# executed.
1212
#
13-
# Here, we overwrite the call to GitHubPages::Configuration.set that init the
14-
# whole plugin to actually do nothing, hence disabling the plugin completely.
15-
# https://github.com/github/pages-gem/blob/master/lib/github-pages.rb#L19
13+
# The GitHub Pages gem prevent access to custom plugins by doing two things:
14+
# - forcing safe mode
15+
# - loading custom plugins from a random dir
16+
#
17+
# We cancel those by disabling safe mode and forcing back plugins to be read
18+
# from ./_plugins.
1619
#
1720
# This file will only be loaded when running `jekyll algolia`, so it won't
1821
# interfere with the regular usage of `jekyll build`
1922
class Configuration
2023
class << self
21-
def set(site); end
24+
def set!(site)
25+
config = effective_config(site.config)
26+
config['safe'] = false
27+
config['plugins_dir'] = '_plugins'
28+
site.config = config
29+
end
2230
end
2331
end
2432
end

0 commit comments

Comments
 (0)