Adding a debug log statment for skipped future posts.

For https://github.com/jekyll/jekyll/issues/4507
This commit is contained in:
Zack Spencer 2016-02-21 15:20:29 +00:00
parent 3213ea70e5
commit 13912482ad
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