Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Interpolated YAML Variables #2672

Open
ghost opened this issue Sep 24, 2019 · 0 comments
Open

Feature Request: Interpolated YAML Variables #2672

ghost opened this issue Sep 24, 2019 · 0 comments

Comments

@ghost
Copy link

ghost commented Sep 24, 2019

Overview

I'd like to associate a YAML file with one or more Markdown documents such that before a Markdown document is converted to HTML, its variable references are first replaced with the definitions from the YAML file.

Interpolated Strings

For the interpolated string values, please see:

Examples

Consider the following files:

  • /user/pages/01.blog/01.typesetting-markdown/definitions.yaml
  • /user/pages/01.blog/01.typesetting-markdown/item.md

In /user/pages/01.blog/01.typesetting-markdown/definitions.yaml:

author:
  name:
    first: Jane
    last: Doe
    full: $author.name.first$ $author.name.last$

In /user/pages/01.blog/01.typesetting-markdown/item.md:

You've reached the blog of $author.name.full$! But, please, call me $author.name.first$.

Produces:

<p>
You've reached the blog of Jane Doe! But, please, call me Jane.
</p>

This could also allow for globally defined page references:

[link]($site.blog.home$/$site.main.filename$.md)

Where:

site:
  blog:
    home: /blog
  main:
    filename: item
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant