Skip to content

Instantly share code, notes, and snippets.

@bazuzu931
Last active April 25, 2018 01:58
Show Gist options
  • Select an option

  • Save bazuzu931/844fccf6f9f56e393e57e93cd59d786f to your computer and use it in GitHub Desktop.

Select an option

Save bazuzu931/844fccf6f9f56e393e57e93cd59d786f to your computer and use it in GitHub Desktop.
jekyll category and post loop
{% assign sorted_cats = site.categories | sort %}
{% for category in sorted_cats %}
<!-- <p><a href="posts/{{ category | first }}">{{ category | first }}</a></p> -->
<p><a href="post.html">{{ category | first }}</a></p>
{% for posts in category %}
{% for post in posts %}
<li><a href="{{site.baseurl}}{{ post.url }}">{{ post.title }}</a></li>
{% endfor %}
{% endfor %}
{% endfor %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment