How to set and inherit variables within different twig templates? I'd like to set a variable in my node.html.twig template:

{% set title = label %}
{{ content }}


The content consists of one field visible only, which has it's own template:

file-link.html.twig

How can I access the title variable of the node template in the file template? I am not sure if importing or extending is the right way since that might cause infinite recursion?

Edit

The file template looks like this (from the bootstrap theme):

{% spaceless %}
  {%
    set classes = [
      icon_only ? 'icon-only',
      not icon_only ? 'icon-' ~ icon_position|clean_class
    ]
  %}
  &lt;span{{ attributes.addClass(classes) }}&gt;
    {% if icon_only %}
      &lt;span class="file-icon"&gt;{{ icon }}&lt;/span&gt;
      &lt;span class="sr-only"&gt;
        &lt;span class="file-link"&gt;{{ link }}&lt;/span&gt;
        &lt;span class="file-size"&gt;{{ file_size }}&lt;/span&gt;
      &lt;/span&gt;
    {% else %}
      {% if icon_position == 'after' %}
        &lt;span class="file-link"&gt;{{ link }}&lt;/span&gt;&lt;span class="file-size"&gt;{{ file_size }}&lt;/span&gt;&lt;span class="file-icon"&gt;{{ icon }}&lt;/span&gt;
      {% else %}
        &lt;span class="file-icon"&gt;{{ icon }}&lt;/span&gt;&lt;span class="file-link"&gt;{{ link }}&lt;/span&gt;&lt;span class="file-size"&gt;{{ file_size }}&lt;/span&gt;
      {% endif %}
    {% endif %}
  &lt;/span&gt;
{% endspaceless %}


Within that template I'd like to print the title of the respective node:

&lt;span class="file-link"&gt;{{ link }}&lt;/span&gt;
&lt;span class="file-node-title"&gt;{{ title }}&lt;/span&gt; {# &lt;&lt; #}
&lt;span class="file-size"&gt;{{ file_size }}&lt;/span&gt;
EDIT

You could write a theme hook in your "mytheme.theme", modifiy the "variables" array and add title to the specific field AND then move the template file (in the original post) to your own theme template directory, make the changes using your new variable (called maybe title) which was provided from theme hook. 



OLD:

First of all, "node.html.twig" is TOO general to claim that it's content in the future will consist only one field (file-link). 

At least rename it to "node--my-content-type.html.twig".
In the file-link.html.twig you won't able to reach the "title" variable (label) of the node. 

You have the following work around: 
{{ content|without('field_file_link') }}
{% include directory ~ '/templates/my-custom-twig.html.twig' with {'title': title}  %}

Which means:
 1. exclude your field from content. 
 2. create your own twig template
 3. Pass any variable from the caller template you would like to pass.

Twig syntax / semantics is still changing, maybe my twig codes of lines can lead to error, but at least it will give you a hint / clue how to achieve this.