Class: Jekyll::Drops::SiteDrop
- Inherits:
-
Drop
- Object
- Liquid::Drop
- Drop
- Jekyll::Drops::SiteDrop
show all
- Extended by:
- Forwardable
- Defined in:
- lib/jekyll/drops/site_drop.rb
Constant Summary
Constants inherited
from Drop
Drop::NON_CONTENT_METHODS
Instance Method Summary
collapse
Methods inherited from Drop
#[]=, #content_methods, #each, #each_key, #hash_for_json, #initialize, #inspect, #key?, #keys, #merge, #merge!, mutable, mutable?, #to_h, #to_json
Instance Method Details
#[](key) ⇒ Object
14
15
16
17
18
19
20
|
# File 'lib/jekyll/drops/site_drop.rb', line 14
def [](key)
if @obj.collections.key?(key) && key != "posts"
@obj.collections[key].docs
else
super(key)
end
end
|
#collections ⇒ Object
30
31
32
|
# File 'lib/jekyll/drops/site_drop.rb', line 30
def collections
@site_collections ||= @obj.collections.values.sort_by(&:label).map(&:to_liquid)
end
|
#html_pages ⇒ Object
26
27
28
|
# File 'lib/jekyll/drops/site_drop.rb', line 26
def html_pages
@site_html_pages ||= @obj.pages.select { |page| page.html? || page.url.end_with?("/") }
end
|
#posts ⇒ Object
22
23
24
|
# File 'lib/jekyll/drops/site_drop.rb', line 22
def posts
@site_posts ||= @obj.posts.docs.sort { |a, b| b <=> a }
end
|