From 4fe871f5c1b7356545aba46db8eb8cb819221ab6 Mon Sep 17 00:00:00 2001 From: Holger Reinhardt Date: Sat, 30 Jan 2016 23:05:28 +0100 Subject: [PATCH] Adding disquis and category, tags to posts --- _layouts/post.html | 37 ++++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/_layouts/post.html b/_layouts/post.html index 91b4303..d986336 100644 --- a/_layouts/post.html +++ b/_layouts/post.html @@ -4,6 +4,39 @@ layout: default
+ + + {% if post.category %} + {% for site_category in site.data.categories %} + {% if site_category.slug == post.category %} + {% assign category = site_category %} + {% endif %} + {% endfor %} + {% if category %} + {% capture category_content %} in {{ category.name }}{% endcapture %} + {% endif %} + {% else %} + {% assign category_content = '' %} + {% endif %} + + + {% if post.tags.size > 0 %} + {% capture tags_content %} with tags {% endcapture %} + {% for post_tag in post.tags %} + {% for data_tag in site.data.tags %} + {% if data_tag.slug == post_tag %} + {% assign tag = data_tag %} + {% endif %} + {% endfor %} + {% if tag %} + {% capture tags_content_temp %}{{ tags_content }}{{ tag.name }}{% if forloop.last == false %}, {% endif %}{% endcapture %} + {% assign tags_content = tags_content_temp %} + {% endif %} + {% endfor %} + {% else %} + {% assign tags_content = '' %} + {% endif %} +
@@ -12,7 +45,7 @@ layout: default {% if page.subtitle %}

{{ page.subtitle }}

{% endif %} - Posted by {% if page.author %}{{ page.author }}{% else %}{{ site.title }}{% endif %} on {{ page.date | date: "%B %-d, %Y" }} + Posted by {% if page.author %}{{ page.author }}{% else %}{{ site.title }}{% endif %} on {{ page.date | date: "%B %-d, %Y" }} {{ category_content }}{{ tags_content }}
@@ -42,6 +75,8 @@ layout: default {% endif %} + {% include disqus.html %} +