How to use variables from config.yml in frontmatter?

Okay, thank you. If I understand you correctly, you might consider creating collections instead. Then, you could build an index page that lists all the colors, like this:

Colors

  • Tangerine href: https://docs/tangerine
  • Fushia href: https://docs/fushia
  • Bubblegum href: https://docs/tangerine

Your _config.yml would include these settings:

collections:
  Red:
    output: true
  Green:
    output: true

Then, you create a folder for each color, like this:

./
└─_Red
│   index.markdown
│   some-doc.markdown
│   some-other-doc.markdown
│   more docs...
└─_Green
│   index.markdown
│   some-doc.markdown
│   some-other-doc.markdown
│   more docs...

You could, of course, set up a permalink to have all your collections in a docs folder, which may be better. I hope this helps!

Here is a link to the official Jekyll documentation on collections:

And here is a link to an article where we go a bit more in-depth here on the forums:

1 Like