diff options
author | Nicolas Kuttler <git@kuttler.eu> | 2015-02-12 13:29:52 +0100 |
---|---|---|
committer | Nicolas Kuttler <git@kuttler.eu> | 2015-02-12 13:29:52 +0100 |
commit | 0b3a8bb29dc13c0150c374f87e7aa8a6ac1a8a55 (patch) | |
tree | 8127d886daaab0ac3c812afe7133699a6b54cfe1 | |
parent | dcf06fc9642a41a69bf1f0e8cafeff5a763918ae (diff) | |
download | irssi.github.io-0b3a8bb29dc13c0150c374f87e7aa8a6ac1a8a55.zip |
Ordinalize without plugin
As the site will be build by github we can't use plugins
-rw-r--r-- | _includes/ordinal.html | 4 | ||||
-rw-r--r-- | _includes/postmeta.html | 9 |
2 files changed, 8 insertions, 5 deletions
diff --git a/_includes/ordinal.html b/_includes/ordinal.html new file mode 100644 index 0000000..690ef57 --- /dev/null +++ b/_includes/ordinal.html @@ -0,0 +1,4 @@ +{% if ordinalize == "1" or ordinalize == "21" or ordinalize == "31" %}st +{% elsif ordinalize == "2" or ordinalize == "22" %}nd +{% elsif ordinalize == "3" or ordinalize == "23" %}rd +{% else %}th{% endif %} diff --git a/_includes/postmeta.html b/_includes/postmeta.html index a44f36d..544ed34 100644 --- a/_includes/postmeta.html +++ b/_includes/postmeta.html @@ -10,10 +10,9 @@ possible on github pages (unless built locally and pushed there). {% else %} {{ node.author }} {% endif %} - {% if node.date %} - {% assign ordinal=node.date | ordinal %} - on {{ node.date | date: "%B %-d" }}{% if ordinal != node.date %}<sup>{{ ordinal }}</sup>{% endif %} - {{ node.date | date: "%Y" }} - {% endif %} + + {% assign ordinalize=node.date | date: "%-d" %} + on {{ node.date | date: "%B %-d" }}<sup>{% include ordinal.html %}</sup> + {{ node.date | date: "%Y" }} </small> </p> |