From ad7efb23e6a00f3a353d8db3b1e4ad56524a54aa Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Sun, 6 Apr 2014 13:43:05 -0400 Subject: [PATCH] Code/docs cleanup, props @baweaver --- lib/jekyll/collection.rb | 2 +- lib/jekyll/document.rb | 13 ++++++------- lib/jekyll/renderer.rb | 2 +- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/lib/jekyll/collection.rb b/lib/jekyll/collection.rb index 13455e2a..4bee732a 100644 --- a/lib/jekyll/collection.rb +++ b/lib/jekyll/collection.rb @@ -79,7 +79,7 @@ module Jekyll # An inspect string. # - # Returns the inspecr string + # Returns the inspect string def inspect "#" end diff --git a/lib/jekyll/document.rb b/lib/jekyll/document.rb index ce4d6bff..ed200511 100644 --- a/lib/jekyll/document.rb +++ b/lib/jekyll/document.rb @@ -7,7 +7,7 @@ module Jekyll # 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 # # Returns nothing. @@ -112,8 +112,7 @@ module Jekyll # # Returns the permalink or nil if no permalink was set in the data. def permalink - return nil if data.nil? || data['permalink'].nil? - data['permalink'] + data && data['permalink'] end # 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. def url @url ||= URL.new({ - :template => url_template, - :placeholders => url_placeholders, - :permalink => permalink + template: url_template, + placeholders: url_placeholders, + permalink: permalink }).to_s end @@ -158,7 +157,7 @@ module Jekyll # # Return the file read options hash. def merged_file_read_opts(opts) - (site ? site.file_read_opts : {}).merge(opts) + site ? site.file_read_opts.merge(opts) : opts end # Whether the file is published or not, as indicated in YAML front-matter diff --git a/lib/jekyll/renderer.rb b/lib/jekyll/renderer.rb index 0fb7b7f1..f9df731e 100644 --- a/lib/jekyll/renderer.rb +++ b/lib/jekyll/renderer.rb @@ -32,7 +32,7 @@ module Jekyll "page" => document.to_liquid }, site.site_payload) - info = { + info = { filters: [Jekyll::Filters], registers: { :site => site, :page => payload['page'] } }