Further consolidation in the Drops.
This commit is contained in:
parent
4935e85f7c
commit
532bb9e9cb
|
@ -10,7 +10,7 @@ module Jekyll
|
||||||
:relative_directory
|
:relative_directory
|
||||||
|
|
||||||
def to_s
|
def to_s
|
||||||
@obj.docs.map(&:to_s).join(' ')
|
docs.to_s
|
||||||
end
|
end
|
||||||
|
|
||||||
def output
|
def output
|
||||||
|
|
|
@ -9,10 +9,6 @@ module Jekyll
|
||||||
|
|
||||||
alias_method :path, :relative_path
|
alias_method :path, :relative_path
|
||||||
|
|
||||||
def url
|
|
||||||
@obj.url
|
|
||||||
end
|
|
||||||
|
|
||||||
def collection
|
def collection
|
||||||
@obj.collection.label
|
@obj.collection.label
|
||||||
end
|
end
|
||||||
|
@ -30,9 +26,7 @@ module Jekyll
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
def fallback_data
|
def_delegator :@obj, :data, :fallback_data
|
||||||
@obj.data
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -6,10 +6,11 @@ module Jekyll
|
||||||
extend Forwardable
|
extend Forwardable
|
||||||
|
|
||||||
def_delegator :@obj, :site_data, :data
|
def_delegator :@obj, :site_data, :data
|
||||||
def_delegators :@obj, :time, :pages, :static_files, :documents
|
def_delegators :@obj, :time, :pages, :static_files, :documents,
|
||||||
|
:tags, :categories
|
||||||
|
|
||||||
def [](key)
|
def [](key)
|
||||||
if !respond_to?(key) && @obj.collections.key?(key)
|
if @obj.collections.key?(key) && key != "posts"
|
||||||
@obj.collections[key].docs
|
@obj.collections[key].docs
|
||||||
else
|
else
|
||||||
super(key)
|
super(key)
|
||||||
|
@ -24,14 +25,6 @@ module Jekyll
|
||||||
@site_html_pages ||= @obj.pages.select { |page| page.html? || page.url.end_with?("/") }
|
@site_html_pages ||= @obj.pages.select { |page| page.html? || page.url.end_with?("/") }
|
||||||
end
|
end
|
||||||
|
|
||||||
def categories
|
|
||||||
@site_categories ||= @obj.post_attr_hash('categories')
|
|
||||||
end
|
|
||||||
|
|
||||||
def tags
|
|
||||||
@site_tags ||= @obj.post_attr_hash('tags')
|
|
||||||
end
|
|
||||||
|
|
||||||
def collections
|
def collections
|
||||||
@site_collections ||= @obj.collections.values.map(&:to_liquid)
|
@site_collections ||= @obj.collections.values.map(&:to_liquid)
|
||||||
end
|
end
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
module Jekyll
|
module Jekyll
|
||||||
module Drops
|
module Drops
|
||||||
class UnifiedPayloadDrop < Liquid::Drop
|
class UnifiedPayloadDrop < ImmutableDrop
|
||||||
|
|
||||||
attr_accessor :page, :layout, :content, :paginator
|
attr_accessor :page, :layout, :content, :paginator
|
||||||
attr_accessor :highlighter_prefix, :highlighter_suffix
|
attr_accessor :highlighter_prefix, :highlighter_suffix
|
||||||
|
@ -19,6 +19,11 @@ module Jekyll
|
||||||
@site_drop ||= SiteDrop.new(@site)
|
@site_drop ||= SiteDrop.new(@site)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
def fallback_data
|
||||||
|
@fallback_data ||= {}
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue