class Jekyll::Drops::SiteDrop
Attributes
current_document[W]
Public Instance Methods
[](key)
click to toggle source
Calls superclass method
Jekyll::Drops::Drop#[]
# File lib/jekyll/drops/site_drop.rb, line 15 def [](key) if key != "posts" && @obj.collections.key?(key) @obj.collections[key].docs else super(key) end end
collections()
click to toggle source
# File lib/jekyll/drops/site_drop.rb, line 37 def collections @site_collections ||= @obj.collections.values.sort_by(&:label).map(&:to_liquid) end
config()
click to toggle source
return nil for ‘{{ site.config }}` even if –config was passed via CLI
# File lib/jekyll/drops/site_drop.rb, line 63 def config; end
documents()
click to toggle source
‘Site#documents` cannot be memoized so that `Site#docs_to_write` can access the latest state of the attribute.
Since this method will be called after ‘Site#pre_render` hook, the `Site#documents` array shouldn’t thereafter change and can therefore be safely memoized to prevent additional computation of ‘Site#documents`.
# File lib/jekyll/drops/site_drop.rb, line 47 def documents @documents ||= @obj.documents end
html_pages()
click to toggle source
# File lib/jekyll/drops/site_drop.rb, line 31 def html_pages @site_html_pages ||= @obj.pages.select do |page| page.html? || page.url.end_with?("/") end end
key?(key)
click to toggle source
Calls superclass method
Jekyll::Drops::Drop#key?
# File lib/jekyll/drops/site_drop.rb, line 23 def key?(key) (key != "posts" && @obj.collections.key?(key)) || super end
posts()
click to toggle source
# File lib/jekyll/drops/site_drop.rb, line 27 def posts @site_posts ||= @obj.posts.docs.sort { |a, b| b <=> a } end