Can I create YAML anchors in _config.yml and call the alias in page frontmatter?

YAML anchors/aliases can only be used within the same file, so *title won’t work. One idea is to set the page title via front-matter defaults. For example:

defaults:
  -
    scope:
      path: "" # an empty string here means all files in the project
    values:
      title: "My reusable title"

Pages without a defined title would get the default “My reusable title”. See the Front-matter Defaults docs for more details.

Another alternative is to modify the layout to default to a global title, if a page title isn’t set. For example, the layout would render the page header using liquid like this:

<h1>{{ page.title | default: site.myTitle }}</h1>
1 Like