diff --git a/lib/jekyll/page.rb b/lib/jekyll/page.rb index 469dbb53..79542d8b 100644 --- a/lib/jekyll/page.rb +++ b/lib/jekyll/page.rb @@ -126,7 +126,7 @@ module Jekyll # The path to the page source file, relative to the site source def relative_path - File.join(@dir, @name) + File.join(*[@dir, @name].map(&:to_s).reject(&:empty?)) end # Obtain destination path. diff --git a/lib/jekyll/post.rb b/lib/jekyll/post.rb index edc5caae..0c95cc7d 100644 --- a/lib/jekyll/post.rb +++ b/lib/jekyll/post.rb @@ -123,7 +123,7 @@ module Jekyll # The path to the post source file, relative to the site source def relative_path - File.join(@dir, '_posts', @name) + File.join(*[@dir, "_posts", @name].map(&:to_s).reject(&:empty?)) end # Compares Post objects. First compares the Post date. If the dates are