Sha256: 3bed242460488f60623380711bf2a2662e165c5052b8f63f86fe784c91aa04cd

Contents?: true

Size: 422 Bytes

Versions: 25

Compression:

Stored size: 422 Bytes

Contents

module Jekyll
  class Publisher
    def initialize(site)
      @site = site
    end

    def publish?(thing)
      can_be_published?(thing) && !hidden_in_the_future?(thing)
    end

    private

    def can_be_published?(thing)
      thing.data.fetch('published', true) || @site.unpublished
    end

    def hidden_in_the_future?(thing)
      thing.is_a?(Post) && !@site.future && thing.date > @site.time
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
jekyll-3.0.0.pre.beta10 lib/jekyll/publisher.rb
jekyll-3.0.0.pre.beta9 lib/jekyll/publisher.rb
jekyll-3.0.0.pre.beta8 lib/jekyll/publisher.rb
jekyll-3.0.0.pre.beta7 lib/jekyll/publisher.rb
jekyll-3.0.0.pre.beta6 lib/jekyll/publisher.rb
jekyll-3.0.0.pre.beta5 lib/jekyll/publisher.rb
jekyll-3.0.0.pre.beta4 lib/jekyll/publisher.rb
jekyll-3.0.0.pre.beta3 lib/jekyll/publisher.rb
jekyll-3.0.0.pre.beta2 lib/jekyll/publisher.rb
jekyll-3.0.0.pre.beta1 lib/jekyll/publisher.rb
jekyll-2.5.3 lib/jekyll/publisher.rb
jekyll-2.5.2 lib/jekyll/publisher.rb
jekyll-2.5.1 lib/jekyll/publisher.rb
jekyll-2.5.0 lib/jekyll/publisher.rb
jekyll-2.4.0 lib/jekyll/publisher.rb
jekyll-2.3.0 lib/jekyll/publisher.rb
jekyll-2.2.0 lib/jekyll/publisher.rb
jekyll-2.1.1 lib/jekyll/publisher.rb
jekyll-2.1.0 lib/jekyll/publisher.rb
jekyll-2.0.3 lib/jekyll/publisher.rb