ソースを参照

Do not show tags and category in side bar if metadata field is empty

It is possible if user do not set any value in it. Ideally he should
remove the metadata field but he may miss to do it.
Talha Mansoor 11 年 前
コミット
02b6a9a7ed
共有1 個のファイルを変更した2 個の追加2 個の削除を含む
  1. 2 2
      templates/article.html

+ 2 - 2
templates/article.html

@@ -84,11 +84,11 @@
             <time pubdate="pubdate" datetime="{{ article.date.isoformat() }}">{{ article.date.strftime('%b') }} {{ day }} {{- article.date.strftime(', %Y') }}</time>
             {% endif %}
             {% include 'last_updated.html' %}
-            {% if article.category %}
+            {% if article.category|trim|count > 0 %}
             <h4>Category</h4>
             <a class="category-link" href="{{ SITEURL }}/categories.html#{{ category.slug }}-ref">{{ article.category }}</a>
             {% endif %}
-            {% if article.tags %}
+            {% if article.tags and article.tags[0]|trim|count > 0 %}
             <h4>Tags</h4>
             <ul class="list-of-tags tags-in-article">
                 {% for tag in article.tags|sort %}