retype icon indicating copy to clipboard operation
retype copied to clipboard

Global authors

Open VeeBack opened this issue 2 years ago • 1 comments

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.

VeeBack avatar May 09 '23 12:05 VeeBack

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.

geoffreymcgill avatar May 09 '23 13:05 geoffreymcgill