Move URL escape to Jekyll::URL
This commit is contained in:
parent
e3e1c11509
commit
c56ce248c9
|
@ -86,8 +86,8 @@ module Jekyll
|
||||||
# desired placeholder replacements. For details see "url.rb"
|
# desired placeholder replacements. For details see "url.rb"
|
||||||
def url_placeholders
|
def url_placeholders
|
||||||
{
|
{
|
||||||
:path => URL.escape_path(@dir),
|
:path => @dir,
|
||||||
:basename => URL.escape_path(basename),
|
:basename => basename,
|
||||||
:output_ext => output_ext
|
:output_ext => output_ext
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
|
@ -208,10 +208,10 @@ module Jekyll
|
||||||
: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 => URL.escape_path(slug),
|
:title => 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| URL.escape_path(c.to_s) }.join('/'),
|
:categories => (categories || []).map { |c| 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 => output_ext
|
:output_ext => output_ext
|
||||||
|
|
|
@ -46,7 +46,7 @@ module Jekyll
|
||||||
# Returns the _unsanitizied_ String URL
|
# Returns the _unsanitizied_ String URL
|
||||||
def generate_url
|
def generate_url
|
||||||
@placeholders.inject(@template) do |result, token|
|
@placeholders.inject(@template) do |result, token|
|
||||||
result.gsub(/:#{token.first}/, token.last)
|
result.gsub(/:#{token.first}/, self.class.escape_path(token.last))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue