title: Jekyll Include one YAML file in another YAML file
body: <p>I have a Jekyll project where two separate pages (A.html and B.html) are displaying different content based on data in YAML files A.yml and B.yml respectively. Each yml file has a bunch of variables that are defined identically. I'd prefer to keep this common list of variables in a third file C.yml and include it into both A.yml and B.yml. How can I do this?</p>
  
  <p>Things I've tried:</p>
  
  <ul>
  <li>Using * to reference global data like <code>*site.data.C.vars</code> - this didn't parse.</li>
  <li>Put C.yml in _includes directory and use front matter treat the page like a liquid template and call <code>{% include C.yml %}</code> - this compiled, but the emitted html page had no content whatsoever.</li>
  </ul>
  
  <h2>Edit - example usage</h2>
  
  <p>Using a common data file in multiple views isn't quite sufficient for me because there would also need to be name-resolution logic in liquid to accompany it. Here's an example of what my data might look like:</p>
  
  <p><strong>A.yml</strong></p>
  
  <pre><code>ingredients:
    - avacado: &amp;avacado
        name: Avacado
        color: Green
        foods:
          - *octopus_ceviche
  </code></pre>
  
  <p><strong>B.yml</strong></p>
  
  <pre><code>chefs:
    - anthony_bourdain: &amp;anthony_bourdain
        name: Anthony Bourdain
        hobby: Brazilian Jiu-Jitsu
        foods:
          - *octopus_ceviche
  </code></pre>
  
  <p><strong>C.yml</strong></p>
  
  <pre><code>foods:
    - octopus_ceviche: &amp;octopus_ceviche
        name: Octopus Ceviche
        taste: Delicious
  </code></pre>
  
  <p>If there's no way to include C.yml in A and B, then all the foods need to be shared in both places. If food is used in the md/html page entries need to be accessed by direct hash access (e.g. <code>{{ site.data.foods[octopus_ceviche] }}</code>), which a) doesn't seem to work and b) feels like too much logic for a view.</p>