mirror of
https://github.com/jekyll/jekyll.git
synced 2026-02-01 10:15:03 -05:00
Use end_with? instead of regexp for adding index.html
This commit is contained in:
@@ -163,7 +163,7 @@ module Jekyll
|
||||
def destination(base_directory)
|
||||
dest = site.in_dest_dir(base_directory)
|
||||
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
|
||||
end
|
||||
|
||||
|
||||
@@ -141,7 +141,7 @@ module Jekyll
|
||||
# Returns the destination file path String.
|
||||
def destination(dest)
|
||||
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
|
||||
end
|
||||
|
||||
|
||||
@@ -279,7 +279,7 @@ module Jekyll
|
||||
def destination(dest)
|
||||
# The url needs to be unescaped in order to preserve the correct filename
|
||||
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
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user