DRY up code, props @tamouse
This commit is contained in:
parent
606c525099
commit
baabe7eb7e
|
@ -126,10 +126,7 @@ module Jekyll
|
||||||
|
|
||||||
# The path to the page source file, relative to the site source
|
# The path to the page source file, relative to the site source
|
||||||
def relative_path
|
def relative_path
|
||||||
File.join([
|
File.join([@dir, @name].map(&:to_s).reject(&:empty?))
|
||||||
@dir.to_s,
|
|
||||||
@name.to_s
|
|
||||||
].reject {|x| x.nil? || x.empty?})
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# Obtain destination path.
|
# Obtain destination path.
|
||||||
|
|
|
@ -133,11 +133,7 @@ module Jekyll
|
||||||
|
|
||||||
# The path to the post source file, relative to the site source
|
# The path to the post source file, relative to the site source
|
||||||
def relative_path
|
def relative_path
|
||||||
File.join([
|
File.join([@dir, "_posts", @name].map(&:to_s).reject(&:empty?))
|
||||||
@dir.to_s,
|
|
||||||
"_posts",
|
|
||||||
@name.to_s
|
|
||||||
].reject {|x| x.nil? || x.empty?})
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# Compares Post objects. First compares the Post date. If the dates are
|
# Compares Post objects. First compares the Post date. If the dates are
|
||||||
|
|
Loading…
Reference in New Issue