I work with the creator of the jekyll static site, and I have difficulty in doing the following:
{% for category in site.categories %} <h2 id = "{{ category[0] }}"> {{ category[0] }} </h2> {% for post in site.categories[{{ category }}] %} <li> <a href="{{ post.url }}"> {{ post.title }}</a></li> {% endfor %} <a href="#{{ category[0] }}-ref">↩</a> {% endfor %}
I have a category of messages on my jekyll site called "test", and I can display messages with the following text on it:
{% for post in site.categories.test %} <li> <a href="{{ post.url }}"> {{ post.title }}</a></li> {% endfor %}
However, I want to create an archive page automatically and in order to do this. I need to insert a category from the external loop (a loop that visits all categories), and use it in the inner loop to access messages from this particular category. What do I need to do to get the first snippet to work as I want?
EDIT: Alternatively, is there any other way to get the results I want?
ruby jekyll liquid
radicalmatt
source share