Created
September 21, 2017 22:14
-
-
Save metinsaylan/831fa55f024d8e3ac910fe400a7a03ed to your computer and use it in GitHub Desktop.
Jekyll loop component to loop posts of a given tag
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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