Is it possible to assign one variable in _config.yml to another?

In _config.yml, I’d like to do something like this:

description: >-
  some 
  really
  long
  description

bio: {{ description }}

In other words, I just want bio to point to, be an alias to, or be an exact copy of, description, so that whether I use {{ site.description }} or {{ site.bio }} in my liquid throughout the site, I get the same thing.

My above attempt doesn’t work. How can I do this?

1 Like

As you discovered, you can’t use Liquid inside _config.yml, but the YAML format has its own mechanism to repeat nodes using achors (&) and aliases (*). For example, if you add the anchor &desc to the description node, then you can aliases is under the bio node:

description: &desc >-
  some 
  really
  long
  description

bio: *desc
3 Likes

This worked perfectly. Thank you! Solved.

Here’s a little more info. about YAML anchors and aliases, now that I know they exist and can search for them: https://support.atlassian.com/bitbucket-cloud/docs/yaml-anchors/.

1 Like