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:
parent
30d8743853
commit
606c525099
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue