Page#dir: ensure it ends in a slash

This commit is contained in:
Parker Moore 2016-01-26 16:44:30 -08:00
parent ce77fe6488
commit 38b64faeb2
1 changed files with 3 additions and 1 deletions

View File

@ -55,7 +55,9 @@ module Jekyll
#
# Returns the String destination directory.
def dir
url[-1, 1] == '/' ? url : File.dirname(url)
dest_dir = url[-1, 1] == '/' ? url : File.dirname(url)
dest_dir << '/' unless dest_dir.end_with?('/')
dest_dir
end
# The full path and filename of the post. Defined in the YAML of the post