Code/docs cleanup, props @baweaver

This commit is contained in:
Parker Moore 2014-04-06 13:43:05 -04:00
parent af61451f87
commit ad7efb23e6
3 changed files with 8 additions and 9 deletions

View File

@ -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

View File

@ -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

View File

@ -32,7 +32,7 @@ module Jekyll
"page" => document.to_liquid "page" => document.to_liquid
}, site.site_payload) }, site.site_payload)
info = { info = {
filters: [Jekyll::Filters], filters: [Jekyll::Filters],
registers: { :site => site, :page => payload['page'] } registers: { :site => site, :page => payload['page'] }
} }