HUGO

Reference a config value in another config value

Is it possible to use one config value to build the value for another config value? Specific example is that I have environment specific domains that I’d like to use in the url parameter for the menu config.

If you are using YAML, you can leverage anchors, aliases, and extends. Here’s a simple example of an anchor and alias:

params:
  foo: &foo "This is the value of foo"
  bar: *foo

But you cannot do something like:

params:
  foo: &foo "This is the value of foo"
  bar: string1 *foo string2

But you cannot do something like:

…is unfortunately exactly what I was hoping to do. Thank you for confirming, though!