Relative
Have you checked how Wikipedia produces output like “1995; 18 years ago” in the
infoboxes ? They have a template for that : {{start date and age|1995}}
.
Well, I like such relative dates. I find them more human readable than absolute dates.
Usage
relative
is a Liquid filter, so you just pass a date to it :
Page last modified {{ page.date }} ( {{ page.date | relative }} ).
Configuration
None.
Versions
- 0.0 - December 2013
- Initial release.
Plans
- Either optional parameter or a separate tag to express the value using integer amounts and multiple units.
Download
You can find the related files on GitHub in my Jekyll-plugin repository’s relative directory :
- relative.rb - script