I'm teaching myself Jekyll and Liquid and was wondering how do you get indexed items of an array?
I can create an array of page.tags and loop through them:
{% assign tags = pages.tags %}
{% for tag in tags %}
{% endfor %}
But say there are four tags and I want to access tag at index 2. I've seen some code like this:
{% for i in 1...page.tags %}
{% endfor %}
But I can't seem to get the index to work, these fail:
{% for i in 1...page.tags %}
<p>{{page.tags[i]}}</p>
{% endfor %}
{% for i in 1...page.tags %}
<p>{{i}}</p>
{% endfor %}