Skip to content

Commit 79b796f

Browse files
authored
Merge pull request #19 from Trybnetic/optional-categories
makes categories optional (fixes #17)
2 parents 2c8868e + 40a4b0b commit 79b796f

File tree

3 files changed

+14
-7
lines changed

3 files changed

+14
-7
lines changed

_layouts/category.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
{% include nav.html %}
88
<div id="content-left">
99
<h2>Category: {{page.category}}</h2>
10+
{% assign content = page.content | strip_newlines %}
11+
{% if content != "" %}
12+
{{content}}
13+
{% endif %}
1014
{% for post in site.categories[page.category] %}
1115
<div id="post-short">
1216
<a href="{{site.url}}{{site.baseurl}}{{post.url}}">

_layouts/post.html

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,15 @@ <h2>{{ page.title }}</h2>
1212
<p>
1313
{{ content }}
1414
</p>
15-
<div id="categories">
16-
<p><b>Categories:</b>&nbsp;
17-
{% for category in page.categories %}
18-
<a href="{{site.url}}{{site.baseurl}}/categories/{{category}}/">#{{category}}</a>&nbsp;
19-
{% endfor %}
20-
</p>
21-
</div>
15+
{% if page.categories.size > 0 %}
16+
<div id="categories">
17+
<p><b>Categories:</b>&nbsp;
18+
{% for category in page.categories %}
19+
<a href="{{site.url}}{{site.baseurl}}/categories/{{category}}/">#{{category}}</a>&nbsp;
20+
{% endfor %}
21+
</p>
22+
</div>
23+
{% endif %}
2224
</div>
2325
</div>
2426
{% include footer.html %}

categories/update.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ layout: category
33
category: update
44
permalink: /categories/update/
55
---
6+
This is an example description.

0 commit comments

Comments
 (0)