put the Cleaner instance in a `Site#site_cleaner` method
This commit is contained in:
parent
0b3005b3b4
commit
d28858a9e9
|
@ -3,7 +3,7 @@ module Jekyll
|
||||||
attr_accessor :config, :layouts, :posts, :pages, :static_files,
|
attr_accessor :config, :layouts, :posts, :pages, :static_files,
|
||||||
:categories, :exclude, :include, :source, :dest, :lsi, :pygments,
|
:categories, :exclude, :include, :source, :dest, :lsi, :pygments,
|
||||||
:permalink_style, :tags, :time, :future, :safe, :plugins, :limit_posts,
|
:permalink_style, :tags, :time, :future, :safe, :plugins, :limit_posts,
|
||||||
:show_drafts, :keep_files, :baseurl, :site_cleaner
|
:show_drafts, :keep_files, :baseurl
|
||||||
|
|
||||||
attr_accessor :converters, :generators
|
attr_accessor :converters, :generators
|
||||||
|
|
||||||
|
@ -87,8 +87,6 @@ module Jekyll
|
||||||
|
|
||||||
self.converters = instantiate_subclasses(Jekyll::Converter)
|
self.converters = instantiate_subclasses(Jekyll::Converter)
|
||||||
self.generators = instantiate_subclasses(Jekyll::Generator)
|
self.generators = instantiate_subclasses(Jekyll::Generator)
|
||||||
|
|
||||||
self.site_cleaner = Cleaner.new(self)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# Internal: Setup the plugin search path
|
# Internal: Setup the plugin search path
|
||||||
|
@ -228,7 +226,7 @@ module Jekyll
|
||||||
#
|
#
|
||||||
# Returns nothing.
|
# Returns nothing.
|
||||||
def cleanup
|
def cleanup
|
||||||
self.site_cleaner.cleanup!
|
site_cleaner.cleanup!
|
||||||
end
|
end
|
||||||
|
|
||||||
# Write static files, pages, and posts.
|
# Write static files, pages, and posts.
|
||||||
|
@ -386,5 +384,9 @@ module Jekyll
|
||||||
limit = self.posts.length < limit_posts ? self.posts.length : limit_posts
|
limit = self.posts.length < limit_posts ? self.posts.length : limit_posts
|
||||||
self.posts = self.posts[-limit, limit]
|
self.posts = self.posts[-limit, limit]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def site_cleaner
|
||||||
|
@site_cleaner ||= Cleaner.new(self)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue