Browse Source

Show a message if no posts exist with the given tags.

master
Ben Kurtovic 9 years ago
parent
commit
30d0809f5b
2 changed files with 4 additions and 0 deletions
  1. +1
    -0
      index.html
  2. +3
    -0
      static/main.js

+ 1
- 0
index.html View File

@@ -118,6 +118,7 @@ title: Home
{% for post in site.posts %}
<li data-tags="{{ post.tags | join: "|" }}">{{ post.date | date: "%b %-d, %Y" }}: <a class="underlined" href="{{ post.url }}">{{ post.title }}</a><br /><span class="subtitle">{{ post.description }}<br />{{ post.tags | join: ", " }} &middot; <a href="{{ post.url }}#disqus_thread" data-disqus-identifier="{{ post.id }}"></a></span></li>
{% endfor %}
<li id="null-post" data-tags="" style="display: none;"><i>No posts with these tags</i></li>
</ul>
</td>
</tr>


+ 3
- 0
static/main.js View File

@@ -11,6 +11,7 @@ function load_tag_filters() {
filter.push($(this).data("tag"))
});
$("#post-list li").show();
$("#null-post").hide();
if ($(".tag-selected").length == 0)
return;
$("#post-list li").each(function() {
@@ -22,6 +23,8 @@ function load_tag_filters() {
}
}
});
if ($("#post-list li:not(:hidden)").length == 0)
$("#null-post").show();
}

if (window.location.hash) {


Loading…
Cancel
Save