summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--_includes/ordinal.html1
-rw-r--r--_includes/postmeta.html4
-rw-r--r--_layouts/home.html3
-rw-r--r--_layouts/post.html3
4 files changed, 5 insertions, 6 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>
diff --git a/_layouts/home.html b/_layouts/home.html
index e0e2187..81451b6 100644
--- a/_layouts/home.html
+++ b/_layouts/home.html
@@ -6,8 +6,7 @@ layout: default
{% for post in paginator.posts %}
<h2><a href="{{ post.url }}">{{ post.title }}</a></h2>
- {% assign node=post %}
- {% include postmeta.html %}
+ {% include postmeta.html node=post %}
{{ post.content | markdownify }}
{% endfor %}
diff --git a/_layouts/post.html b/_layouts/post.html
index d6b9678..5cf11df 100644
--- a/_layouts/post.html
+++ b/_layouts/post.html
@@ -3,6 +3,5 @@ layout: default
---
<h2>{{ page.title }}</h2>
-{% assign node=page %}
-{% include postmeta.html %}
+{% include postmeta.html node=page %}
{{ page.content | markdownify }}