Last few revisions

This commit is contained in:
Alfred Xing 2014-11-28 14:05:40 -08:00
parent a701e59c07
commit d0e12d69bc
4 changed files with 12 additions and 4 deletions

View File

@ -13,7 +13,7 @@ module Jekyll
# Cleans up the site's destination directory
def cleanup!
FileUtils.rm_rf(obsolete_files)
FileUtils.rm_rf(metadata_file) if @site.config["full_rebuild"]
FileUtils.rm_rf(metadata_file) if @site.full_rebuild?
end
private

View File

@ -22,6 +22,7 @@ module Jekyll
'encoding' => 'utf-8',
'markdown_ext' => 'markdown,mkdown,mkdn,mkd,md',
'textile_ext' => 'textile',
'full_rebuild' => false,
# Filtering Content
'show_drafts' => nil,

View File

@ -16,7 +16,7 @@ module Jekyll
#
# Returns true, also on failure.
def add(path)
return true if not File.exist? path
return true unless File.exist?(path)
metadata[path] = {
"mtime" => File.mtime(path),
@ -100,7 +100,7 @@ module Jekyll
#
# Returns a Boolean (true for disabled, false for enabled).
def disabled?
@disabled = site.config['full_rebuild'] if @disabled.nil?
@disabled = site.full_rebuild? if @disabled.nil?
@disabled
end

View File

@ -319,7 +319,7 @@ module Jekyll
each_site_file { |item|
item.write(dest) if item.regenerate?
}
metadata.write unless config['full_rebuild']
metadata.write unless full_rebuild?
end
# Construct a Hash of Posts indexed by the specified Post attribute.
@ -490,6 +490,13 @@ module Jekyll
@frontmatter_defaults ||= FrontmatterDefaults.new(self)
end
# Whether to perform a full rebuild without metadata
#
# Returns a Boolean: true for a full rebuild, false for normal build
def full_rebuild?(override = {})
override['full_rebuild'] || config['full_rebuild']
end
private
def has_relative_page?