Get static filename

This commit is contained in:
Frank Taillandier 2016-08-20 17:42:05 +02:00
parent 594a6bf193
commit 87c00b2756
No known key found for this signature in database
GPG Key ID: E73258E3F50AEB7E
2 changed files with 3 additions and 1 deletions

View File

@ -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)

View File

@ -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"