Skip to content

Commit

Permalink
Merge pull request #19 from Trybnetic/optional-categories
Browse files Browse the repository at this point in the history
makes categories optional (fixes #17)
  • Loading branch information
Trybnetic authored Sep 10, 2017
2 parents 2c8868e + 40a4b0b commit 79b796f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
4 changes: 4 additions & 0 deletions _layouts/category.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
{% include nav.html %}
<div id="content-left">
<h2>Category: {{page.category}}</h2>
{% assign content = page.content | strip_newlines %}
{% if content != "" %}
{{content}}
{% endif %}
{% for post in site.categories[page.category] %}
<div id="post-short">
<a href="{{site.url}}{{site.baseurl}}{{post.url}}">
Expand Down
16 changes: 9 additions & 7 deletions _layouts/post.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@ <h2>{{ page.title }}</h2>
<p>
{{ content }}
</p>
<div id="categories">
<p><b>Categories:</b>&nbsp;
{% for category in page.categories %}
<a href="{{site.url}}{{site.baseurl}}/categories/{{category}}/">#{{category}}</a>&nbsp;
{% endfor %}
</p>
</div>
{% if page.categories.size > 0 %}
<div id="categories">
<p><b>Categories:</b>&nbsp;
{% for category in page.categories %}
<a href="{{site.url}}{{site.baseurl}}/categories/{{category}}/">#{{category}}</a>&nbsp;
{% endfor %}
</p>
</div>
{% endif %}
</div>
</div>
{% include footer.html %}
Expand Down
1 change: 1 addition & 0 deletions categories/update.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ layout: category
category: update
permalink: /categories/update/
---
This is an example description.

0 comments on commit 79b796f

Please sign in to comment.