class Jekyll::Drops::SiteDrop
def [](key)
def [](key) if key != "posts" && @obj.collections.key?(key) @obj.collections[key].docs else super(key) end end
def collections
def collections @site_collections ||= @obj.collections.values.sort_by(&:label).map(&:to_liquid) end
def config; end
def config; end
def documents
array shouldn't thereafter change and can therefore be safely memoized to prevent
Since this method will be called after `Site#pre_render` hook, the `Site#documents`
latest state of the attribute.
`Site#documents` cannot be memoized so that `Site#docs_to_write` can access the
def documents @documents ||= @obj.documents end
def html_pages
def html_pages @site_html_pages ||= @obj.pages.select do |page| page.html? || page.url.end_with?("/") end end
def key?(key)
def key?(key) (key != "posts" && @obj.collections.key?(key)) || super end
def posts
def posts @site_posts ||= @obj.posts.docs.sort { |a, b| b <=> a } end
def related_posts
recent posts.
them, either through LSI if it's enabled, or through the most
`{{ site.related_posts }}` is how posts can get posts related to
def related_posts return nil unless @current_document.is_a?(Jekyll::Document) @current_document.related_posts end