summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Kuttler <git@kuttler.eu>2015-02-12 01:29:15 +0100
committerNicolas Kuttler <git@kuttler.eu>2015-02-12 01:29:15 +0100
commit27c911c3ea5bc5c1a0db37003c72dbea3801319c (patch)
tree74f1988c53af5302c05807c66dbe75beabc64377
parent50362a666ecfbc15d6beec2a4a89346526ac2e69 (diff)
downloadirssi.github.io-27c911c3ea5bc5c1a0db37003c72dbea3801319c.zip
Display meta information about posts
The date will be displayed with an ordinal indicator when available.
-rw-r--r--_includes/postmeta.html19
-rw-r--r--_layouts/home.html2
-rw-r--r--_layouts/post.html4
3 files changed, 24 insertions, 1 deletions
diff --git a/_includes/postmeta.html b/_includes/postmeta.html
new file mode 100644
index 0000000..a44f36d
--- /dev/null
+++ b/_includes/postmeta.html
@@ -0,0 +1,19 @@
+{% comment %}
+This will use the ordinal plugin when it's available. This is not
+possible on github pages (unless built locally and pushed there).
+{% endcomment %}
+<p>
+ <small>
+ Posted by
+ {% if node.email %}
+ <a href="mailto:{{ node.email }}">{{ node.author }}</a>
+ {% 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 %}
+ </small>
+</p>
diff --git a/_layouts/home.html b/_layouts/home.html
index 9a2976a..e0e2187 100644
--- a/_layouts/home.html
+++ b/_layouts/home.html
@@ -6,6 +6,8 @@ layout: default
{% for post in paginator.posts %}
<h2><a href="{{ post.url }}">{{ post.title }}</a></h2>
+ {% assign node=post %}
+ {% include postmeta.html %}
{{ post.content | markdownify }}
{% endfor %}
diff --git a/_layouts/post.html b/_layouts/post.html
index aa390ea..d6b9678 100644
--- a/_layouts/post.html
+++ b/_layouts/post.html
@@ -3,4 +3,6 @@ layout: default
---
<h2>{{ page.title }}</h2>
-{{ page.content|markdownify }}
+{% assign node=page %}
+{% include postmeta.html %}
+{{ page.content | markdownify }}