Use symbols for all placeholders

See https://github.com/mojombo/jekyll/pull/944#discussion_r5443105
for a discussion.
This commit is contained in:
Lucas Jenss 2013-07-31 23:11:51 +02:00
parent f5d0be9660
commit cce58159ce
2 changed files with 13 additions and 13 deletions

View File

@ -76,9 +76,9 @@ module Jekyll
# See url.rb for an explanation # See url.rb for an explanation
def url_placeholders def url_placeholders
{ {
"path" => @dir, :path => @dir,
"basename" => self.basename, :basename => self.basename,
"output_ext" => self.output_ext :output_ext => self.output_ext
} }
end end

View File

@ -208,16 +208,16 @@ module Jekyll
# See url.rb for an explanation # See url.rb for an explanation
def url_placeholders def url_placeholders
{ {
"year" => date.strftime("%Y"), :year => date.strftime("%Y"),
"month" => date.strftime("%m"), :month => date.strftime("%m"),
"day" => date.strftime("%d"), :day => date.strftime("%d"),
"title" => CGI.escape(slug), :title => CGI.escape(slug),
"i_day" => date.strftime("%d").to_i.to_s, :i_day => date.strftime("%d").to_i.to_s,
"i_month" => date.strftime("%m").to_i.to_s, :i_month => date.strftime("%m").to_i.to_s,
"categories" => (categories || []).map { |c| URI.escape(c.to_s) }.join('/'), :categories => (categories || []).map { |c| URI.escape(c.to_s) }.join('/'),
"short_month" => date.strftime("%b"), :short_month => date.strftime("%b"),
"y_day" => date.strftime("%j"), :y_day => date.strftime("%j"),
"output_ext" => self.output_ext :output_ext => self.output_ext
} }
end end