diff options
author | Nicolas Kuttler <git@kuttler.eu> | 2015-02-12 17:24:03 +0100 |
---|---|---|
committer | Nicolas Kuttler <git@kuttler.eu> | 2015-02-12 17:24:03 +0100 |
commit | c59344a2ac4c3aa6e53f1d4299e1a29f0568f3a3 (patch) | |
tree | d41d54517cc7dc37c7fd3d003f8d6bfe69d320c2 /_includes | |
parent | 8b7b806819af71d57b35505f05c54d8e216bc1d3 (diff) | |
download | irssi.github.io-c59344a2ac4c3aa6e53f1d4299e1a29f0568f3a3.zip |
Refactor includes
Includes can pass variables after all. The template language is
beginning to feel clumsy.
Diffstat (limited to '_includes')
-rw-r--r-- | _includes/ordinal.html | 1 | ||||
-rw-r--r-- | _includes/postmeta.html | 4 |
2 files changed, 3 insertions, 2 deletions
diff --git a/_includes/ordinal.html b/_includes/ordinal.html index 690ef57..c942963 100644 --- a/_includes/ordinal.html +++ b/_includes/ordinal.html @@ -1,3 +1,4 @@ +{% assign ordinalize=include.ordinalize %} {% if ordinalize == "1" or ordinalize == "21" or ordinalize == "31" %}st {% elsif ordinalize == "2" or ordinalize == "22" %}nd {% elsif ordinalize == "3" or ordinalize == "23" %}rd diff --git a/_includes/postmeta.html b/_includes/postmeta.html index 7308a07..45241e1 100644 --- a/_includes/postmeta.html +++ b/_includes/postmeta.html @@ -1,3 +1,4 @@ +{% assign node=include.node %} <p> <small> Posted by @@ -7,8 +8,7 @@ {{ node.author }} {% endif %} - {% assign ordinalize=node.date | date: "%-d" %} - on {{ node.date | date: "%B %-d" }}<sup>{% include ordinal.html %}</sup> + on {{ node.date | date: "%B %-d" }}<sup>{% include ordinal.html ordinalize=node.date | date: "%-d" %}</sup> {{ node.date | date: "%Y" }} </small> </p> |