Created
April 13, 2017 19:49
-
-
Save sskylar/968daf7dd6a876381c2d0663a1a933af to your computer and use it in GitHub Desktop.
Loop through a particular category (or tag) with Jekyll/Siteleaf
This file contains 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
{% for post in site.posts %} | |
{% if post.categories contains 'Foo' %} | |
<li>{{ post.title }}</li> | |
{% endif %} | |
{% endfor %} |
This file contains 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
{% assign posts = site.posts | where_exp: "post", "post.categories contains 'Foo'" %} | |
{% for post in posts %} | |
<li>{{ post.title }}</li> | |
{% endfor %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment