Hi I'm working on a Jekyll project and I need to put a variable in _config.yml that I want to change dynamically from the template code.
This is what I want to do, but I can't get it to work. Is it possible to do this?
In _config.yml:
my_var: "value"
In template.html:
{% site.my_var = "newvalue" %}
{% case site.my_var %}
{% when "value" %}
//do this
{% when "newvalue" %}
//do this instead
{% endcase %}
While you apparently cannot use Liquid conditionals nor Environment Variables (as in many other build scripts), you can do a selective overrides with a second yml file:
with a
_dev.yml
:Perhaps that fits your needs...