diff --git a/lib/jekyll/static_file.rb b/lib/jekyll/static_file.rb index 29d71cbe8e7..18bcec800dc 100644 --- a/lib/jekyll/static_file.rb +++ b/lib/jekyll/static_file.rb @@ -1,7 +1,11 @@ module Jekyll class StaticFile + extend Forwardable + attr_reader :relative_path, :extname, :name, :data + def_delegator :to_liquid, :to_json, :to_json + class << self # The cache of last modification times [path] -> mtime. def mtimes diff --git a/test/test_static_file.rb b/test/test_static_file.rb index 49adc96b79f..418b83d8055 100644 --- a/test/test_static_file.rb +++ b/test/test_static_file.rb @@ -174,5 +174,9 @@ def setup_static_file_with_defaults(base, dir, name, defaults) } assert_equal expected, @static_file.to_liquid.to_h end + + should "jsonify its liquid drop instead of itself" do + assert_equal @static_file.to_liquid.to_json, @static_file.to_json + end end end