Created
March 26, 2021 21:00
-
-
Save clawfire/c4c4596ddf530a58ab6795063968db2f to your computer and use it in GitHub Desktop.
How to exclude a category from Jekyll loop and limit the number of posts
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
{% for post in site.posts limit: 6 %} | |
{% assign count = 0 %} | |
{% unless post.categories contains 'talks' %} | |
{% assign count = count+1 %} | |
{% unless count<=3 %} | |
{% include component__post-preview.html %} | |
{% endunless %} | |
{% endunless %} | |
{% endfor %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment