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

Add support for referencing terms in YAML Frontmatter using Jekyll #13

Closed
lukenoaa opened this issue Nov 21, 2024 · 3 comments
Closed

Comments

@lukenoaa
Copy link
Member

Add support for referencing terms in YAML Frontmatter using Jekyll (or Hugo). Now that we have all the terms at the top in the YAML frontmatter, we can reference those terms when they appear in the Markdown body. Example (I put this file in the repo but it doesn't render correctly yet):

---
title: "My Document"
author: "John Doe"
date: "2024-11-16"
---

# {{ page.title }}

Written by {{ page.author }} on {{ page.date }}.

The downside is most Markdown renderers don't support Jekyll natively. So far it looks like the best way to get the documents to render the content for viewing and printing is GitHub Pages. We could make a GitHub Pages site for our AOML protocols repository.

@lukenoaa
Copy link
Member Author

lukenoaa commented Jan 8, 2025

Got it working with pandoc-mustache. See https://github.com/aomlomics/protocols/blob/main/test_pandoc-mustache.md.

@lukenoaa
Copy link
Member Author

lukenoaa commented Jan 8, 2025

It's ok if the YAML frontmatter has all the variable names, but the first term must be be mustache: ./vars.yaml (or whatever the YAML file is called) to prevent an error from being thrown. So, a simple script would be to 1- copy all the YAML frontmatter to vars.yaml, 2- add mustache: ./vars.yaml as the first term in the file, 3- run pandoc.

@lukenoaa
Copy link
Member Author

Issue closed with addition of pandoc and pandoc-mustache.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant