I am using Jekyll as a static generator for a website (not a blog), and I want to have an automatically generated list of all pages on my index page. Specifically, I want to
There's a cleaner way to do this using the liquid "contains" property:
categories: [fruit, meat, vegetable, cheese, drink]
---
layout: page
title: Orange juice
description: Orange juice is juice from oranges. It's made by squeezing oranges.
categories: [fruit, drink]
---
{% for page in site.pages %}
{% if page.categories contains 'fruit' %}
{{page.title}}
{{page.description}}
{% endif %}
{% endfor %}