I need the name from several yml
files sorted, alphabetically on the output.
I've tried to add | sort: 'name'
in my for loop. I get:
Liquid Exception: no implicit conversion of String into Integer in pages/index.html
Sample _data/cat/example1.yml
name: "test1"
permalink: "/test"
twitter: "WIP"
facebook: "WIP"
web: "WIP"
I have at least 3 yml files in my test in the /cat
folder.
Sample Include File
<div class="row">
{% for cat_hash in site.data.cat %}
{% assign cat = cat_hash[1] | sort: 'name' %}
<div class="col-6 col-12-narrower">
<section>
<header>
<a class="image featured" href="{{ cat.permalink }}" title="{{ cat.name }}"><h3>{{ cat.name }}</h3></a>
</header>
<p>{{ cat.web }}</p>
</section>
</div>
{% endfor %}
</div>
I've read several examples with this sort issue. Just not sure if any of the hash results in the loop answered my situation?
{{ datas.name }}
{{ cat.web }}
{{ cat.name }}
{{ cat.web }}