Merge pull request #4558 from zandaleph/log-future
Merge pull request 4558
This commit is contained in:
commit
85685a8981
|
@ -8,14 +8,14 @@ module Jekyll
|
||||||
can_be_published?(thing) && !hidden_in_the_future?(thing)
|
can_be_published?(thing) && !hidden_in_the_future?(thing)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def hidden_in_the_future?(thing)
|
||||||
|
thing.respond_to?(:date) && !@site.future && thing.date.to_i > @site.time.to_i
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def can_be_published?(thing)
|
def can_be_published?(thing)
|
||||||
thing.data.fetch('published', true) || @site.unpublished
|
thing.data.fetch('published', true) || @site.unpublished
|
||||||
end
|
end
|
||||||
|
|
||||||
def hidden_in_the_future?(thing)
|
|
||||||
thing.respond_to?(:date) && !@site.future && thing.date.to_i > @site.time.to_i
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -35,7 +35,11 @@ module Jekyll
|
||||||
read_content(dir, magic_dir, matcher).tap do |docs|
|
read_content(dir, magic_dir, matcher).tap do |docs|
|
||||||
docs.each(&:read)
|
docs.each(&:read)
|
||||||
end.select do |doc|
|
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
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue