In Jekyll, I would really like to have the date format as “2nd December 2012” — i.e. with the ordinal, rather than just “2 December 2012”.
I see that there’s an ordinalize function available in Ruby to do this, but I haven’t had any luck combining it with Liquid and Jekyll.
How can I format dates as I would like?
I solved this by writing the following Jekyll plugin, which I placed in the
_pluginsdirectory with an arbitrary name, e.g.date.rb:Then — having installed the
facetsRuby gem — I was able to use{{ post.date | pretty }}in my site, and all was well.