From 1666bbc52e3d3c76655c126ca6219b9e04b1660d Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Mon, 11 Aug 2014 20:16:42 -0400 Subject: [PATCH] Call #to_liquid before calling #to_json in jsonify filter. --- lib/jekyll/filters.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/jekyll/filters.rb b/lib/jekyll/filters.rb index 002d926f..16a5ff38 100644 --- a/lib/jekyll/filters.rb +++ b/lib/jekyll/filters.rb @@ -155,7 +155,7 @@ module Jekyll # # Returns the converted json string def jsonify(input) - input.to_json + as_liquid(input).to_json end # Group an array of items by a property @@ -254,5 +254,9 @@ module Jekyll item[property.to_s] end end + + def as_liquid(item) + item.respond_to?(:to_liquid) ? item.to_liquid : item + end end end