diff --git a/lib/jekyll/publisher.rb b/lib/jekyll/publisher.rb index 6bb8a882..cc739627 100644 --- a/lib/jekyll/publisher.rb +++ b/lib/jekyll/publisher.rb @@ -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 diff --git a/lib/jekyll/readers/post_reader.rb b/lib/jekyll/readers/post_reader.rb index 1bf8ca29..f7a44ca7 100644 --- a/lib/jekyll/readers/post_reader.rb +++ b/lib/jekyll/readers/post_reader.rb @@ -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