How to use a variable included in a layout in posts using that layout?
<p>Consider the following three snippets from the specified files:</p>

<pre><code>&lt;!-- _includes/my_var.html --&gt;
{% assign my_var = 'foo' %}
</code></pre>

<p>and</p>

<pre><code>&lt;!-- _layouts/default.html --&gt;
{% include my_var.html %}
...
</code></pre>

<p>and a post:</p>

<pre><code>---
layout: default
---
I'd like to reference {{my_var}}
</code></pre>

<p>The last one doesn't appear to see the variable defined in the includes file. I get <code>nil</code> as the value of <code>my_var</code>. Am I wrong to expect that it should be in scope? If so, what's an alternative approach?</p>