CyanPrime
CyanPrime

Reputation: 5193

Simple for loop not working in Jekyll

I can't figure out for the life of me why this won't work...

<p>
{% for game in site.data.games %}
    <span>{% game.name %}</span>
{% endfor %}
</P>

I'm getting this error:

 Liquid Exception: Unknown tag 'game' in games/index.html

And using this .yml in the _data folder...

games:
  - name: Game1
    platforms: { win32, win64, linux64 }
    distribution:
      here: null
      desura: http://www.desura.com/games/Game1
      source: https://github.com/mygithub/Game1
    description: cg/games/Game1/description.html
    release: 2013-06-23

  - name: Game2
    platforms: {win32, win64, mac, linux32, linux64, android, ios, ouya, web}
    distribution:
      here: null
      desura: null
      steam: null
    description: cg/games/Game2/description.html
    release: 2015-Q1

Upvotes: 1

Views: 442

Answers (1)

David Jacquel
David Jacquel

Reputation: 52829

Not the correct syntax ;

<span>{{ game.name }}</span>

Upvotes: 4

Related Questions