Skip to content

Commit 50e8ecf

Browse files
committed
Add tags to post listings
1 parent 92c2f10 commit 50e8ecf

3 files changed

Lines changed: 10 additions & 5 deletions

File tree

_includes/postlisting.html

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
<div class="bloglisting">
2-
<h2><a href="{{include.url}}">{{include.title}}</a></h2>
2+
<h2><a href="{{include.url}}">{{include.title}}</a></h2>
33
<small>{{include.date | date: "%a %b %d %Y"}}</small>
44
<small><a href="{{include.url}}#commento"></a></small>
5-
6-
<p>{{include.excerpt}}</p>
5+
<small class="tags">~ Tags:
6+
{%for tag in include.tags %}
7+
<a href="{{ "tags" | relative_url }}/{{tag}}.html">{{tag}}</a>
8+
{%endfor%}
9+
</small>
10+
11+
<p>{{include.excerpt | strip_html }}</p>
712
<a href="{{include.url}}">Read more..</a>
813
</div>

_layouts/tag.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ <h1>Posts with tag: {{page.tag}}</h1>
77
<a href="{{ site.url }}/feed/by_tag/{{ page.tag }}.xml">RSS feed for tag</a>
88
<hr />
99
{% for post in site.tags[page.tag] %}
10-
{% include postlisting.html title=post.title date=post.date url=post.url excerpt=post.excerpt %}
10+
{% include postlisting.html title=post.title date=post.date url=post.url excerpt=post.excerpt tags=post.tags %}
1111
<hr />
1212
{% endfor %}
1313

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ <h3>Tags:
4848

4949
<!-- Posts -->
5050
{% for post in paginator.posts %}
51-
{% include postlisting.html title=post.title date=post.date url=post.url excerpt=post.excerpt %}
51+
{% include postlisting.html title=post.title date=post.date url=post.url excerpt=post.excerpt tags=post.tags %}
5252
<hr />
5353
{% endfor %}
5454

0 commit comments

Comments
 (0)