To add author information to a Jekyll site, you can create a data file that contains author information and then reference that data in the front matter of each post.
Here are the steps to add author information to a Jekyll site:
- Create a _data directory in your site’s root directory if it doesn’t already exist.
- Inside the _data directory, create a new YAML file named authors.yml.
-
In authors.yml, add the information for each author. For example:
johndoe: name: John Doe email: john@doe.com bio: Software developer and blogger janedoe: name: Jane Doe email: jane@doe.com bio: Writer and editor Billy Rick: name: Billy Rick picture: /images/authors/bio-photo-2.jpg twitter: "@billyrick" links: - title: Twitter url: https://twitter.com/billyrick icon: fab fa-twitter-square Cornelius Fiddlebone: name: Cornelius Fiddlebone picture: /images/authors/bio-photo.jpg twitter: corneliusfiddlebone
In this example, four authors, John Doe, Jane Doe, Billy Rick and Cornelius Fiddlebone, have been added to the file along with their name, email, bio, profile picture and links to their social media accounts.
- Save the changes to authors.yml.
-
Open a post that should have author information and add the author’s identifier to the post’s front matter. For example:
--- layout: post title: "My Post Title" author: johndoe ---
In this example, the post has been assigned to the “johndoe” author.
- Save the changes to the post’s front matter.
- Finally, you can display the author information on each post by updating the post’s layout file to include the author information. For example, you can add the following code to the bottom of your post’s layout file:
<p>Written by Jeny Amatya</p>
<p>Scrum Master, Agile enthusiast, Full stack developer</p>
<p>Email: <a href="mailto:"></a></p>
This code will display the author’s name, bio, and email address on each post.
In summary, to add author information to a Jekyll site, you need to create a data file that contains author information, reference that data in the front matter of each post, and update the post’s layout file to display the author information.