Get static filename
This commit is contained in:
parent
594a6bf193
commit
87c00b2756
|
@ -1,6 +1,6 @@
|
|||
module Jekyll
|
||||
class StaticFile
|
||||
attr_reader :relative_path, :extname
|
||||
attr_reader :relative_path, :extname, :name
|
||||
|
||||
class << self
|
||||
# The cache of last modification times [path] -> mtime.
|
||||
|
@ -97,6 +97,7 @@ module Jekyll
|
|||
|
||||
def to_liquid
|
||||
{
|
||||
"filename" => File.basename(name, extname),
|
||||
"extname" => extname,
|
||||
"modified_time" => modified_time,
|
||||
"path" => File.join("", relative_path)
|
||||
|
|
|
@ -134,6 +134,7 @@ class TestStaticFile < JekyllUnitTest
|
|||
|
||||
should "be able to convert to liquid" do
|
||||
expected = {
|
||||
"filename" => "static_file",
|
||||
"extname" => ".txt",
|
||||
"modified_time" => @static_file.modified_time,
|
||||
"path" => "/static_file.txt"
|
||||
|
|
Loading…
Reference in New Issue