title: How to iterate and retrieve from YAML _data in Jekyll?
body: <p>I'm trying to build a Jekyll blog. But I never used YAML before and I'm going mad with the logic of this thing.</p>
  
  <p>First I wrote a YAML file in <code>_data/authors.yml</code> with a list of authors and their respective meta-info:</p>
  
  <pre><code>- authors:
      - user: andre
        name: Andre Santos
        site: http://test.dev
        email: andre@test.dev
  
      - user: john
        name: John Doe
        site:
        email: john.doe@test.dev
  </code></pre>
  
  <p>Now I want to do two very simple things: first, to iterate over all authors, displaying some info about them:</p>
  
  <pre><code>{% for list in site.data.authors %}
     {% for author in list %}
        {{ author.user }} - {{ author.user.name }}
     {% endfor %}
  {% endfor %}
  </code></pre>
  
  <p>But it shows nothing!</p>
  
  <p>Now in some other part of the code I just want to retrieve info from a specific user:</p>
  
  <pre><code>{% assign the_user = site.data.authors.authors[post.username] %}
  {{ the_user.name }}
  </code></pre>
  
  <p>And, once again it shows nothing! I have no idea what I'm doing wrong, I tried lots of other solutions, iterations, but I can't make heads or tails about how to iterate YAML files, and I don't know Ruby so most of the solutions I found in this site don't work for me when I adapt them into Jekyll + Liquid.</p>
  
  <p>What am I doing wrong? How to access those variables?</p>