mirror of
https://github.com/jekyll/jekyll.git
synced 2026-01-30 01:08:26 -05:00
Add StaticFile#to_liquid and StaticFile#relative_path
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user