Use end_with? instead of regexp for adding index.html
This commit is contained in:
parent
4da6bfd81a
commit
3f3b203992
|
@ -163,7 +163,7 @@ module Jekyll
|
||||||
def destination(base_directory)
|
def destination(base_directory)
|
||||||
dest = site.in_dest_dir(base_directory)
|
dest = site.in_dest_dir(base_directory)
|
||||||
path = site.in_dest_dir(dest, URL.unescape_path(url))
|
path = site.in_dest_dir(dest, URL.unescape_path(url))
|
||||||
path = File.join(path, "index.html") if url =~ /\/$/
|
path = File.join(path, "index.html") if url.end_with?("/")
|
||||||
path
|
path
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -141,7 +141,7 @@ module Jekyll
|
||||||
# Returns the destination file path String.
|
# Returns the destination file path String.
|
||||||
def destination(dest)
|
def destination(dest)
|
||||||
path = site.in_dest_dir(dest, URL.unescape_path(url))
|
path = site.in_dest_dir(dest, URL.unescape_path(url))
|
||||||
path = File.join(path, "index.html") if url =~ /\/$/
|
path = File.join(path, "index.html") if url.end_with?("/")
|
||||||
path
|
path
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -279,7 +279,7 @@ module Jekyll
|
||||||
def destination(dest)
|
def destination(dest)
|
||||||
# The url needs to be unescaped in order to preserve the correct filename
|
# The url needs to be unescaped in order to preserve the correct filename
|
||||||
path = site.in_dest_dir(dest, URL.unescape_path(url))
|
path = site.in_dest_dir(dest, URL.unescape_path(url))
|
||||||
path = File.join(path, "index.html") if self.url =~ /\/$/
|
path = File.join(path, "index.html") if self.url.end_with?("/")
|
||||||
path
|
path
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue