You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by mg...@apache.org on 2015/11/20 08:51:25 UTC

wicket-site git commit: Add checks for the version of Jekyll in the plugins

Repository: wicket-site
Updated Branches:
  refs/heads/asf-site 1eba3a096 -> 8bd1fbfaf


Add checks for the version of Jekyll in the plugins


Project: http://git-wip-us.apache.org/repos/asf/wicket-site/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket-site/commit/8bd1fbfa
Tree: http://git-wip-us.apache.org/repos/asf/wicket-site/tree/8bd1fbfa
Diff: http://git-wip-us.apache.org/repos/asf/wicket-site/diff/8bd1fbfa

Branch: refs/heads/asf-site
Commit: 8bd1fbfaf0fbdb5cda64c6ced623d6c0d3459996
Parents: 1eba3a0
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
Authored: Fri Nov 20 08:50:44 2015 +0100
Committer: Martin Tzvetanov Grigorov <mg...@apache.org>
Committed: Fri Nov 20 08:51:16 2015 +0100

----------------------------------------------------------------------
 _plugins/monthly_archive_plugin.rb | 7 ++++++-
 _plugins/tiered_archives_plugin.rb | 7 ++++++-
 _plugins/yearly_archive_plugin.rb  | 7 ++++++-
 3 files changed, 18 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/wicket-site/blob/8bd1fbfa/_plugins/monthly_archive_plugin.rb
----------------------------------------------------------------------
diff --git a/_plugins/monthly_archive_plugin.rb b/_plugins/monthly_archive_plugin.rb
index 51f3b89..7c1ea85 100644
--- a/_plugins/monthly_archive_plugin.rb
+++ b/_plugins/monthly_archive_plugin.rb
@@ -35,7 +35,12 @@ module Jekyll
     end
 
     def posts_group_by_year_and_month(site)
-      site.posts.docs.each.group_by { |post| [post.date.year, post.date.month] }
+      if Jekyll::VERSION < '3.0.0'
+        posts = site.posts
+      else
+        posts = site.posts.docs
+      end
+      posts.each.group_by { |post| [post.date.year, post.date.month] }
     end
 
   end

http://git-wip-us.apache.org/repos/asf/wicket-site/blob/8bd1fbfa/_plugins/tiered_archives_plugin.rb
----------------------------------------------------------------------
diff --git a/_plugins/tiered_archives_plugin.rb b/_plugins/tiered_archives_plugin.rb
index 9245db9..3994724 100644
--- a/_plugins/tiered_archives_plugin.rb
+++ b/_plugins/tiered_archives_plugin.rb
@@ -21,8 +21,13 @@ class Jekyll::Site
   alias :site_payload_without_tiered_archives :site_payload
 
   def site_payload
+	if Jekyll::VERSION < '3.0.0'
+      posts = self.posts
+    else
+      posts = self.posts.docs
+    end
     data = site_payload_without_tiered_archives
-    data['site']['years'] = TieredArchives::find_years(self.posts.docs.reverse)
+    data['site']['years'] = TieredArchives::find_years(posts.reverse)
     data
   end
 end

http://git-wip-us.apache.org/repos/asf/wicket-site/blob/8bd1fbfa/_plugins/yearly_archive_plugin.rb
----------------------------------------------------------------------
diff --git a/_plugins/yearly_archive_plugin.rb b/_plugins/yearly_archive_plugin.rb
index a585522..fdb8d6a 100644
--- a/_plugins/yearly_archive_plugin.rb
+++ b/_plugins/yearly_archive_plugin.rb
@@ -35,7 +35,12 @@ module Jekyll
     end
 
     def posts_group_by_year(site)
-      site.posts.docs.each.group_by { |post| [post.date.year] }
+      if Jekyll::VERSION < '3.0.0'
+        posts = site.posts
+      else
+        posts = site.posts.docs
+      end
+      posts.each.group_by { |post| [post.date.year] }
     end
 
   end