diff --git a/lib/jekyll/page.rb b/lib/jekyll/page.rb index eda87f123..6bdfb6bc4 100644 --- a/lib/jekyll/page.rb +++ b/lib/jekyll/page.rb @@ -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