Relative posts should never fail to build, even if @dir or @name is nil

Fixes https://github.com/jekyll/jekyll/issues/1963
This commit is contained in:
Parker Moore 2014-01-21 23:50:16 -05:00
parent 30d8743853
commit 606c525099
2 changed files with 9 additions and 2 deletions

View File

@ -126,7 +126,10 @@ module Jekyll
# The path to the page source file, relative to the site source
def relative_path
File.join(@dir, @name)
File.join([
@dir.to_s,
@name.to_s
].reject {|x| x.nil? || x.empty?})
end
# Obtain destination path.

View File

@ -133,7 +133,11 @@ 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.to_s,
"_posts",
@name.to_s
].reject {|x| x.nil? || x.empty?})
end
# Compares Post objects. First compares the Post date. If the dates are