Merge pull request #4558 from zandaleph/log-future

Merge pull request 4558
This commit is contained in:
jekyllbot 2016-03-08 06:22:13 -08:00
commit 85685a8981
2 changed files with 9 additions and 5 deletions

View File

@ -8,14 +8,14 @@ module Jekyll
can_be_published?(thing) && !hidden_in_the_future?(thing)
end
def hidden_in_the_future?(thing)
thing.respond_to?(:date) && !@site.future && thing.date.to_i > @site.time.to_i
end
private
def can_be_published?(thing)
thing.data.fetch('published', true) || @site.unpublished
end
def hidden_in_the_future?(thing)
thing.respond_to?(:date) && !@site.future && thing.date.to_i > @site.time.to_i
end
end
end

View File

@ -35,7 +35,11 @@ module Jekyll
read_content(dir, magic_dir, matcher).tap do |docs|
docs.each(&:read)
end.select do |doc|
site.publisher.publish?(doc)
site.publisher.publish?(doc).tap do |will_publish|
if !will_publish && site.publisher.hidden_in_the_future?(doc)
Jekyll.logger.debug "Skipping:", "#{doc.relative_path} has a future date"
end
end
end
end