retype
retype copied to clipboard
Global authors
Make it possible to have a global list of authors in the project config file with their name, email etc, and then on each page you would only need to provide an email.
Thanks for the suggestion.
There is a way to get something similar working using includes.
The first step is to create the file _includes/frank.md and use the following content:
- name: Frank
email: [email protected]
Then add the include to the author config of your page using the syntax {{ include "frank" }}. The following sample.md file demonstrates:
---
author:
{{ include "frank" }}
---
# Sample
Sample page.
If you revise the frank.md file and save, all pages where you included {{ include "frank" }} will also be automatically updated.
You can stack authors by just repeating the include for each author. For instance, the following sample demonstrates adding both Frank and Maria as authors:
---
author:
{{ include "frank" }}
{{ include "maria" }}
---
# Sample
Sample page.
Just add _includes/maria.md with the new author details:
- name: Maria
email: [email protected]
Hope this helps.