Skip to content

Commit

Permalink
Merge pull request #61 from lukemcgregor/empty-tags
Browse files Browse the repository at this point in the history
If no tags present, don't show `. On`
  • Loading branch information
joshgerdes authored Jun 8, 2017
2 parents 6bc41d1 + 5e064d3 commit 0bbe29d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
5 changes: 4 additions & 1 deletion _layouts/post.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
<article class="post-container post-container--single">
<header class="post-header">
<div class="post-meta">
<time datetime="{{ page.date | date: "%-d %b %Y" }}" class="post-meta__date date">{{ page.date | date: "%-d %b %Y" }}</time> &#8226; <span class="post-meta__tags">on {% for tag in page.tags %}<a href="{{ site.baseurl }}tags/#{{ tag }}">{{ tag }}</a> {% endfor %}</span>
<time datetime="{{ page.date | date: "%-d %b %Y" }}" class="post-meta__date date">{{ page.date | date: "%-d %b %Y" }}</time>
{% if page.tags.size > 0 %}
&#8226; <span class="post-meta__tags">on {% for tag in page.tags %}<a href="{{ site.baseurl }}tags/#{{ tag }}">{{ tag }}</a> {% endfor %}</span>
{% endif %}
</div>
<h1 class="post-title">{{ page.title }}</h1>
</header>
Expand Down
7 changes: 6 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@
<li>
<h2 class="post-list__post-title post-title"><a href="{{ site.baseurl }}{{ post.url | remove_first: '/' }}" title="{{ post.title }}">{{ post.title }}</a></h2>
<p class="excerpt">{{ post.excerpt | remove: '<p>' | remove: '</p>' }}&hellip;</p>
<div class="post-list__meta"><time datetime="{{ post.date | date: "%-d %b %Y" }}" class="post-list__meta--date date">{{ post.date | date: "%-d %b %Y" }}</time> &#8226; <span class="post-meta__tags">on {% for tag in post.tags %}<a href="{{ site.baseurl }}tags/#{{ tag }}">{{ tag }}</a> {% endfor %}</span></div>
<div class="post-list__meta">
<time datetime="{{ post.date | date: "%-d %b %Y" }}" class="post-list__meta--date date">{{ post.date | date: "%-d %b %Y" }}</time>
{% if post.tags.size > 0 %}
&#8226; <span class="post-meta__tags">on {% for tag in post.tags %}<a href="{{ site.baseurl }}tags/#{{ tag }}">{{ tag }}</a> {% endfor %}</span>
{% endif %}
</div>
<hr class="post-list__divider">
</li>
{% endfor %}
Expand Down

0 comments on commit 0bbe29d

Please sign in to comment.