Code/docs cleanup, props @baweaver
This commit is contained in:
parent
af61451f87
commit
ad7efb23e6
|
@ -79,7 +79,7 @@ module Jekyll
|
||||||
|
|
||||||
# An inspect string.
|
# An inspect string.
|
||||||
#
|
#
|
||||||
# Returns the inspecr string
|
# Returns the inspect string
|
||||||
def inspect
|
def inspect
|
||||||
"#<Jekyll::Collection @label=#{label} docs=#{docs}>"
|
"#<Jekyll::Collection @label=#{label} docs=#{docs}>"
|
||||||
end
|
end
|
||||||
|
|
|
@ -7,7 +7,7 @@ module Jekyll
|
||||||
|
|
||||||
# Create a new Document.
|
# Create a new Document.
|
||||||
#
|
#
|
||||||
# shit - the Jekyll::Site instance to which this Document belongs
|
# site - the Jekyll::Site instance to which this Document belongs
|
||||||
# path - the path to the file
|
# path - the path to the file
|
||||||
#
|
#
|
||||||
# Returns nothing.
|
# Returns nothing.
|
||||||
|
@ -112,8 +112,7 @@ module Jekyll
|
||||||
#
|
#
|
||||||
# Returns the permalink or nil if no permalink was set in the data.
|
# Returns the permalink or nil if no permalink was set in the data.
|
||||||
def permalink
|
def permalink
|
||||||
return nil if data.nil? || data['permalink'].nil?
|
data && data['permalink']
|
||||||
data['permalink']
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# The computed URL for the document. See `Jekyll::URL#to_s` for more details.
|
# The computed URL for the document. See `Jekyll::URL#to_s` for more details.
|
||||||
|
@ -121,9 +120,9 @@ module Jekyll
|
||||||
# Returns the computed URL for the document.
|
# Returns the computed URL for the document.
|
||||||
def url
|
def url
|
||||||
@url ||= URL.new({
|
@url ||= URL.new({
|
||||||
:template => url_template,
|
template: url_template,
|
||||||
:placeholders => url_placeholders,
|
placeholders: url_placeholders,
|
||||||
:permalink => permalink
|
permalink: permalink
|
||||||
}).to_s
|
}).to_s
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -158,7 +157,7 @@ module Jekyll
|
||||||
#
|
#
|
||||||
# Return the file read options hash.
|
# Return the file read options hash.
|
||||||
def merged_file_read_opts(opts)
|
def merged_file_read_opts(opts)
|
||||||
(site ? site.file_read_opts : {}).merge(opts)
|
site ? site.file_read_opts.merge(opts) : opts
|
||||||
end
|
end
|
||||||
|
|
||||||
# Whether the file is published or not, as indicated in YAML front-matter
|
# Whether the file is published or not, as indicated in YAML front-matter
|
||||||
|
|
Loading…
Reference in New Issue