Skip to content

Instantly share code, notes, and snippets.

@cyjake
Created August 30, 2012 03:10
Show Gist options
  • Save cyjake/3521950 to your computer and use it in GitHub Desktop.
Save cyjake/3521950 to your computer and use it in GitHub Desktop.
[jekyll] [liquid] How to list posts of current page's category
{% for category in site.categories %}
{% if page.categories contains category[0] %}
<section>
<h3>{{ category | first | capitalize }}</h3>
{% assign posts = category[1] %}
</section>
{% endif %}
{% endfor %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment