You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This works fine as long as we don't shallow a variable twice.
Currently it's hard to predict the final value of a variable when shallowing it multiple time in different profiles.
Describe the solution you'd like
tera allow to pass serde_json::Value in its context.
This would allow to write variable using all the toml semantic in a more structured way.
enable to write structured variables context for dotfiles template and eliminate some off the mental load currently required to remember which variables file is loaded were etc.
Enable better templating experience
.class {
{%- if profiles is containing("fancy") -%}
color: {{red}}
{%- else -%}
color: {{black}}
{%- endif -%}
}
We could provide some default context like os, profiles, locale etc.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
While the current template system works it feels a bit messy.
The template context is updated using a
Hashmap<String, String>
, merging values from sub profiles in the global context.Current templating system
We have a global variable file enabled in
bombadil.toml
Containing the following variables:
We can overwrite
wallpaper
using an additional profileThis works fine as long as we don't shallow a variable twice.
Currently it's hard to predict the final value of a variable when shallowing it multiple time in different profiles.
Describe the solution you'd like
tera allow to pass
serde_json::Value
in its context.This would allow to write variable using all the toml semantic in a more structured way.
Example
The following approach as several advantages :
os
,profiles
,locale
etc.The text was updated successfully, but these errors were encountered: