I need help using _data in Jekyll to generate content.
Let's say I want to create a directory displaying countries that have blocked Twitter and Facebook. I understand how to query the _data folder but how do I create something like categories in the _data .yml and query that data?
Let me try to explain.
Twitter is blocked in Turkey & Iran so I'd start with this (networks.yml in _data):
- network: Twitter
This is where I get stuck. What I don't understand is if I'd want to "tag" or "categorize" Twitter like this:
- network: Twitter
blockedcountries: [Turkey, Iran, Iraq]
- network: Facebook
blockedcountries: [Iraq, Turkey]
Then I'd want pages at mysite.com/turkey/ that would display the networks tagged with turkey. Something like this:
{% for network in site.data.networks %}
{% if network.blockedcountries == Turkey %}
<li>{{ network.network }} is blocked in Turkey</li>
{% endif %}
{% endfor %}`
Which would display:
- Twitter is blocked in Turkey
- Facebook is blocked in Turkey
Appreciate any help and will tip Bitcoin if solved!