Skip to content

Instantly share code, notes, and snippets.

@metinsaylan
Created September 21, 2017 22:14
Show Gist options
  • Save metinsaylan/831fa55f024d8e3ac910fe400a7a03ed to your computer and use it in GitHub Desktop.
Save metinsaylan/831fa55f024d8e3ac910fe400a7a03ed to your computer and use it in GitHub Desktop.
Jekyll loop component to loop posts of a given tag
<ul class="post-loop">
{% assign post_exp = "post.tags contains '" | append: include.tag | append: "'" %}
{% assign posts = site.posts | where_exp: "post", post_exp %}
{% for post in posts %}
<li><a class="post-title" href="{{ site.baseurl }}{{ post.url }}">{{ post.title }} <small class="post-date">{{ post.date | date_to_string }}</small></a></li>
{% endfor %}
</ul>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment