From ce7808d9ef7a127bac52de470e6d83cbfaf78457 Mon Sep 17 00:00:00 2001 From: "Andreas Renberg (IQAndreas)" Date: Sat, 28 Sep 2013 09:01:39 +0200 Subject: [PATCH 1/2] Fix compatibility with Jekyll >= 1.1.0 Adds an additional argument added in a newer Jekyll version. Luckily, since the value is optional, this plugin is still compatible with older versions of Jekyll. Fixes https://github.com/mpalmer/jekyll-static-comments/issues/13 --- static_comments.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/static_comments.rb b/static_comments.rb index 184b059..ae4ad0e 100644 --- a/static_comments.rb +++ b/static_comments.rb @@ -21,8 +21,8 @@ class Jekyll::Post alias :to_liquid_without_comments :to_liquid - def to_liquid - data = to_liquid_without_comments + def to_liquid(attrs = nil) + data = to_liquid_without_comments(attrs) data['comments'] = StaticComments::find_for_post(self) data['comment_count'] = data['comments'].length data From a66590df437e0bd99e12e585e049126e79f81b6d Mon Sep 17 00:00:00 2001 From: "Andreas Renberg (IQAndreas)" Date: Sun, 20 Oct 2013 22:31:05 +0200 Subject: [PATCH 2/2] Allow compatibility for previous versions of Jekyll --- static_comments.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static_comments.rb b/static_comments.rb index ae4ad0e..a4e117d 100644 --- a/static_comments.rb +++ b/static_comments.rb @@ -22,7 +22,7 @@ class Jekyll::Post alias :to_liquid_without_comments :to_liquid def to_liquid(attrs = nil) - data = to_liquid_without_comments(attrs) + data = (attrs.nil? ? to_liquid_without_comments() : to_liquid_without_comments(attrs)) data['comments'] = StaticComments::find_for_post(self) data['comment_count'] = data['comments'].length data