From acdd585f330398f54ee46cac07b022872383686e Mon Sep 17 00:00:00 2001 From: Patrice Brend'amour Date: Tue, 6 Sep 2016 23:37:26 +0200 Subject: [PATCH 1/3] Update octopress-date-format.rb fixed names of hooks. They are called :pages and :posts --- lib/octopress-date-format.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/octopress-date-format.rb b/lib/octopress-date-format.rb index 1fbbba7..c98a6a9 100644 --- a/lib/octopress-date-format.rb +++ b/lib/octopress-date-format.rb @@ -117,7 +117,7 @@ def datetime(input) DateFormat.config = site.config end - Jekyll::Hooks.register [:page, :post], :post_init do |item| + Jekyll::Hooks.register [:pages, :posts], :post_init do |item| DateFormat.hack_date(item) end else From 454033b44243d5b0a6ac7d49aadd75bfae0f9e5a Mon Sep 17 00:00:00 2001 From: Patrice Brend'amour Date: Thu, 8 Sep 2016 22:28:02 +0200 Subject: [PATCH 2/3] Also add date fields for documents --- lib/octopress-date-format.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/octopress-date-format.rb b/lib/octopress-date-format.rb index c98a6a9..d51489a 100644 --- a/lib/octopress-date-format.rb +++ b/lib/octopress-date-format.rb @@ -117,7 +117,7 @@ def datetime(input) DateFormat.config = site.config end - Jekyll::Hooks.register [:pages, :posts], :post_init do |item| + Jekyll::Hooks.register [:pages, :posts, :documents], :post_init do |item| DateFormat.hack_date(item) end else From 2d4eee1d4b1fe1548cfa28ba970446d13743800f Mon Sep 17 00:00:00 2001 From: Patrice Brend'amour Date: Fri, 9 Sep 2016 15:48:35 +0200 Subject: [PATCH 3/3] Using pre_render phase instead as it will not add the correct date otherwise --- lib/octopress-date-format.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/octopress-date-format.rb b/lib/octopress-date-format.rb index d51489a..abb47c0 100644 --- a/lib/octopress-date-format.rb +++ b/lib/octopress-date-format.rb @@ -117,7 +117,7 @@ def datetime(input) DateFormat.config = site.config end - Jekyll::Hooks.register [:pages, :posts, :documents], :post_init do |item| + Jekyll::Hooks.register [:pages, :posts, :documents], :pre_render do |item| DateFormat.hack_date(item) end else