mirror of
https://github.com/seigler/dash-docs
synced 2025-07-27 01:36:13 +00:00
Build: allow repeated rebuilding in Jekyll Preview mode
The events and contributor plugins both monkey patched the `site` object. This worked fine when they were loaded once per site build, but with Jekyll 3.0 automatic site rebuilding in preview and watch modes, this applied the monkey patch recursively, causing the program to halt. With this commit, the monkey patching should only occur once per run.
This commit is contained in:
parent
be6167d8fb
commit
b9e114efe8
2 changed files with 24 additions and 20 deletions
|
@ -78,6 +78,7 @@ module Jekyll
|
||||||
|
|
||||||
def generate(site)
|
def generate(site)
|
||||||
# Set site.contributors global variables for liquid/jekyll
|
# Set site.contributors global variables for liquid/jekyll
|
||||||
|
if ! site.respond_to?('corecontributors')
|
||||||
class << site
|
class << site
|
||||||
attr_accessor :corecontributors
|
attr_accessor :corecontributors
|
||||||
attr_accessor :sitecontributors
|
attr_accessor :sitecontributors
|
||||||
|
@ -91,6 +92,7 @@ module Jekyll
|
||||||
h
|
h
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
# Set site.corecontributors and site.sitecontributors arrays
|
# Set site.corecontributors and site.sitecontributors arrays
|
||||||
site.corecontributors = {}
|
site.corecontributors = {}
|
||||||
|
|
|
@ -42,8 +42,9 @@ module Jekyll
|
||||||
|
|
||||||
def generate(site)
|
def generate(site)
|
||||||
# Set site.meetups and site.conferences global variables for liquid/jekyll
|
# Set site.meetups and site.conferences global variables for liquid/jekyll
|
||||||
|
if ! site.respond_to?('conferences')
|
||||||
class << site
|
class << site
|
||||||
attr_accessor :conferences
|
attr_accessor :meetups, :conferences
|
||||||
alias event_site_payload site_payload
|
alias event_site_payload site_payload
|
||||||
def site_payload
|
def site_payload
|
||||||
h = event_site_payload
|
h = event_site_payload
|
||||||
|
@ -53,6 +54,7 @@ module Jekyll
|
||||||
h
|
h
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
# Set site.conferences array
|
# Set site.conferences array
|
||||||
site.conferences = {}
|
site.conferences = {}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue