Add StaticFile#to_liquid and StaticFile#relative_path
This commit is contained in:
parent
9659cfe876
commit
b5a398bdff
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue