From 1769e1cdcfe58339eb6ff7f13925090edaa8a4a8 Mon Sep 17 00:00:00 2001 From: davidtsadler Date: Fri, 30 Dec 2011 00:55:09 +0000 Subject: Add archives page and ordinalize plugin. --- _site_build/_plugins/date.rb | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 _site_build/_plugins/date.rb (limited to '_site_build/_plugins') diff --git a/_site_build/_plugins/date.rb b/_site_build/_plugins/date.rb new file mode 100644 index 0000000..f1a3c26 --- /dev/null +++ b/_site_build/_plugins/date.rb @@ -0,0 +1,19 @@ +module Jekyll + module DateFilter + def ordinalize(date) + day = date.day + if (11..13).include?(day % 100) + "#{day}th" + else + case day % 10 + when 1; "#{day}st" + when 2; "#{day}nd" + when 3; "#{day}rd" + else "#{day}th" + end + end + end + end +end + +Liquid::Template.register_filter(Jekyll::DateFilter) -- cgit v1.2.3-13-gbd6f