title: How should I pass assigned variables to an included Jekyll file?
body: <p>I use github pages to host a jekyll website. In order to quickly switch beetween the online base URL and the locale base URL, I have a variable in the start of my default layout file:</p>
  
  <pre><code>&lt;!--{% assign root = site.github.url %}--&gt;
  {% assign root = "." %}
  </code></pre>
  
  <p>However, if I try to use that variable in an included file, it doesn't work. I know it should be refered as <code>{{ include.root }}</code> and I tried several variations so far, but none worked:</p>
  
  <pre><code>  {% include rail.html root =  root %}
    {% include rail.html root =  page.root %}
    {% include rail.html root =  {{ root }} %}
  </code></pre>
  
  <p>Any idea of what I should do?</p>
  
  <p>Note that I am calling the include from an index file using the <code>default.html</code> file as layout. I can print the <code>root</code> variable correctly in that index file.</p>
  
  <p>Also, how can I share a parent data context without having to pass all the parameters to my included file?</p>
  
  <hr>
  
  <p>edit: it looks like I got something wrong. I tried to put inline posts into an include and the data context is perfectly shared. No idea why it doesn't work with my root variable only in the includes</p>