I would like to make a categories page.
{% for post in site.categories[CATEGORY_NAME] %}
<li><a href="{{ post.url }}">{{ post.title }}</a> ({{post.date|date:"%-d %B %Y"}})</li>
{% endfor %}
Is it possible to use a page parameter to fill in CATEGORY_NAME
? Then I could have one file category.html
which could serve as the index page for multiple categories (i.e. category.html?name=food
and category.html?name=animals
.
I've found a few plugins that handle this, but it seems like overkill to require a plugin.
Here's the most related forum post I could find.
https://groups.google.com/forum/#!topic/jekyll-rb/y-dq-63Uvy4
If I can't do this without a plug in, is there a good reason?
I think the correct answer is that Jekyll pages must be compiled to html before they are served. This is not possible if the liquid language takes a parameter.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With