2014-07-31 15:37:41 +02:00
---
2016-03-25 19:19:12 +01:00
title: "Layout: Author Override"
2016-03-07 04:32:01 +01:00
author: Billy Rick
2014-07-31 15:37:41 +02:00
excerpt: "A post to test author overrides using a data file."
---
2016-03-07 15:51:50 +01:00
2016-04-09 03:49:50 +02:00
Sites that may have content authored from various individuals can be accommodated by using [data files ](https://jekyllrb.com/docs/datafiles/ ).
2014-07-31 15:37:41 +02:00
2016-04-09 03:49:50 +02:00
To attribute an author to a post or page that is different from the site author specified in `_config.yml` :
2014-07-31 15:37:41 +02:00
2016-04-09 03:49:50 +02:00
**Step 1.** Create `_data/authors.yml` and add authors using the following format. Anything variables found under `author` in `_config.yml` can be used (e.g. `name` , `avatar` , `uri` , social media profiles, etc.).
2014-07-31 15:37:41 +02:00
2016-04-01 22:12:37 +02:00
```yaml
2016-02-24 22:12:21 +01:00
# /_data/authors.yml
2014-07-31 15:37:41 +02:00
2016-03-07 04:32:01 +01:00
Billy Rick:
2016-04-09 03:49:50 +02:00
name: "Billy Rick"
uri: "http://thewhip.com"
email: "billy@rick.com"
2014-07-31 15:37:41 +02:00
bio: "What do you want, jewels? I am a very extravagant man."
2016-04-09 03:49:50 +02:00
avatar: "bio-photo-2.jpg"
twitter: "extravagantman"
2014-07-31 15:37:41 +02:00
2016-03-07 04:32:01 +01:00
Cornelius Fiddlebone:
2016-04-09 03:49:50 +02:00
name: "Cornelius Fiddlebone"
email: "cornelius@thewhip.com"
2014-07-31 15:37:41 +02:00
bio: "I ordered what?"
2016-04-09 03:49:50 +02:00
avatar: "bio-photo.jpg"
twitter: "rhymeswithsackit"
2016-04-01 22:12:37 +02:00
```
2014-07-31 15:37:41 +02:00
2016-04-09 03:49:50 +02:00
**Step 2.** Assign one of the authors in `authors.yml` to a post or page you wish to override the `site.author` with.
Example: To assign `Billy Rick` as an author for a post the following YAML Front Matter would be applied:
2014-07-31 15:37:41 +02:00
2016-04-01 22:12:37 +02:00
```yaml
2016-03-07 04:32:01 +01:00
author: Billy Rick
2016-04-09 03:49:50 +02:00
```