Skip to content

Commit

Permalink
Merge pull request #420 from iamchrissmith/add-categories-to-blog-posts
Browse files Browse the repository at this point in the history
Add categories to blog posts
  • Loading branch information
alicetragedy authored Oct 23, 2017
2 parents d68ebf2 + a1ba3fe commit 8cc3958
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
20 changes: 20 additions & 0 deletions _layouts/post.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,26 @@ <h1>{{ page.title }}</h1>
{{ page.author }}
{% endif %}
</p>
{% if page.categories && page.categories > 0 %}
<p class="meta categories">Categories:
{% for category in page.categories %}
<span class="tag">
{% if forloop.last == true %}
<span class="lowercase">and</span>
{% else %}
{% if forloop.first == false %}
,
{% endif %}
{% endif %}
{% if category == 'blog' %}
<a href="/blog">{{ category }}</a>
{% else %}
<a href="/blog/categoryview/#{{ category }}">{{ category | replace:'-',' ' }}</a>
{% endif %}
</span>
{% endfor %}
</p>
{% endif %}
{{ content }}
<div class="blog-share">
<div class="shariff" data-services="[&quot;twitter&quot;,&quot;facebook&quot;,&quot;googleplus&quot;]" data-lang="en"></div>
Expand Down
10 changes: 10 additions & 0 deletions assets/stylesheets/blog.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,16 @@
text-decoration: underline;
}
}
.meta.categories {
margin-top:-15px;
font-size: 80%;
.tag {
text-transform:capitalize;
}
.lowercase {
text-transform: lowercase;
}
}
img {
width: 100%;
height: auto;
Expand Down

0 comments on commit 8cc3958

Please sign in to comment.