Jekyll liquid filter to output a date ordinal such as "st", "nd", "rd", or "th".
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


Jekyll liquid filter to output a date ordinal such as "st", "nd", "rd", or "th".


To use this with your Jekyll site, copy ordinal.rb to your _plugins folder.

NOTE: Because GitHub Pages disables the use of any Jekyll plugins with the --safe option if you want to deploy your Jekyll site to GitHub you’ll need to convert the site locally and push the generated static files to your GitHub repository instead of the Jekyll source files.


To use the filter, simply pass a date string such as or and the filter will return the ordinal for that day.

{{ | ordinal }}

Note that only the ordinal will be returned. This is by design to make the formatting of the ordinal easier such as wrapping it in <sup> html tags.

<sup>{{ | ordinal }}</sup>

Other Resources


This plugin is hereby released into the public domain. To the extent possible, the author places no restrictions upon its use, modification, or redistribution.