So I understand how to map variables in config.yml
that are available globally with {{site.[var]}}
. But since we can’t use Liquid in page frontmatter, is it possible to create a YAML anchor in the config file that’s available in my page frontmatter with the corresponding alias? Or possibly using some other method?
For example, I’m using Jekyll to write a book, and there are several pages that need the same title (they’re poems, so just go with me here). I’m using Tom Johnson’s Jekyll theme, so I have YAML files to handle the sidebar & topnav, plus each individual page needs its title. Meaning the title needs to appear maybe a dozen times.
I’d like to do something like this in the config file:
myTitle: &title My reusable title
—and then call it in a page like this:
---
title: *title
author: My Name
layout: page
---
But I can’t figure out a syntax that doesn’t require Liquid to call, if this is even possible.
Any ideas?