Globally share variables I have 4 main template folders, under the /craft folder (each template folder works for another subdomain). 

Now, I do have per template folder, a few variables that I like to have shared amongst all templates underneath it.

Such as: 

{% set projectsGroup = "projectsWeather" %}
{% set sliderGroup = "sliderWeather" %}
{% set faqGroup = "faqWeather" %}


Which are different, per template folder.

Now, when I put these variables at the top of my master _layout file, this gets shared nicely amongst all templates -- that is, for those that use this _layout file. 

I do however also have a few json generation template files, that can not use the _layout file. 

My question now is how to elegantly assign these variables, and do this only once. 

I can not stick them in a separate file and just use "include" or "extend", because then _layout either ignores or complains. 

Any ideas?
Add them to the environmentVariables section of your config file, and retrieve them using the craft.config template tag.

For example:

// Config 
"environmentVariables" =&gt; [
    "color" =&gt; "blue",
]

// Template
{{ craft.config.environmentVariables.color }}