Skip to main content

Set a global variable in config.yml

It’s possible to set variables in your theme’s config.yml file. If you have a variable that you want to be global, like perhaps a variable that sets the color of the masthead to “blue”, config.yml is a great place to do that. These variables, and the data associated with them, are subsequently available in all templates and layouts.

Varaibles in config.yml:

# Global Variables
data:
  show_search: true
  masthead: "blue"
  some_global_html: "<p>Hello world!</p>"

Last updated on February 15, 2021.

We welcome all questions, feedback and bug reports. If you're having an issue, we usually need the following information:

  • A brief description of the issue
  • A link to the page where you saw the issue
  • Screenshots that illustrate the problem - How do I take a screenshot?

Kindly email CleanSlate@mail.wvu.edu for help or use the form on the request help page.