Add StaticFile#to_liquid['extname'] :)
This commit is contained in:
parent
33490e4efc
commit
e3dd908d55
|
@ -75,7 +75,8 @@ module Jekyll
|
|||
def to_liquid
|
||||
{
|
||||
"path" => relative_path,
|
||||
"modified_time" => mtime.to_s
|
||||
"modified_time" => mtime.to_s,
|
||||
"extname" => File.extname(relative_path)
|
||||
}
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
---
|
||||
---
|
||||
|
||||
{% for file in site.static_files %}
|
||||
- {{ file.path }} last edited at {{ file.modified_time }}
|
||||
{% endfor %}
|
||||
- {{ file.path }} last edited at {{ file.modified_time }} with extname {{ file.extname }}{% endfor %}
|
||||
|
|
|
@ -46,7 +46,12 @@ class TestGeneratedSite < Test::Unit::TestCase
|
|||
end
|
||||
|
||||
should "print a nice list of static files" do
|
||||
assert_equal "", File.read(dest_dir('static_files.html'))
|
||||
expected_output = Regexp.new <<-OUTPUT
|
||||
- /css/screen.css last edited at \\d+ with extname .css
|
||||
- /products.yml last edited at \\d+ with extname .yml
|
||||
- /symlink-test/symlinked-dir/screen.css last edited at \\d+ with extname .css
|
||||
OUTPUT
|
||||
assert_match expected_output, File.read(dest_dir('static_files.html'))
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue