Add StaticFile#to_liquid and StaticFile#relative_path

This commit is contained in:
Parker Moore 2014-02-19 13:35:13 -05:00
parent 9659cfe876
commit b5a398bdff
1 changed files with 12 additions and 0 deletions

View File

@ -21,6 +21,11 @@ module Jekyll
File.join(@base, @dir, @name)
end
# Returns the source file path relative to the site source
def relative_path
path.sub(/\A#{@site.source}/, '')
end
# Obtain destination path.
#
# dest - The String path to the destination dir.
@ -66,5 +71,12 @@ module Jekyll
@@mtimes = Hash.new
nil
end
def to_liquid
{
"path" => relative_path,
"modified_time" => mtime.to_s
}
end
end
end