Table of Contents
Adding authors to your Tokyo Jekyll theme is a straightforward process that involves just two steps. Here’s how to do it:
Step 1: Assign an Author ID to Your Post
In the front matter of your blog post, you’ll need to include the author_id
field. This ID links your post to a specific author.
author_id: 3
For example, your post’s front matter might look like this:
---
layout: post
title: "Test Post Title"
date: 2019-08-01 10:59:37 +0600
post_image: /assets/images/blog-images/blog-img16.jpg
tags: [tag1, tag2, tag3]
categories: [category-name]
author_id: 3
comments: false
excerpt: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."
---
Here, the author_id is set to 3. You can use any unique number (e.g., 3, 4, 5) to identify different authors.
Step 2: Create an Author Entry in the _authors Data Folder
After assigning an author_id to your post, you must create a corresponding HTML file for that author within your _authors data folder. This file contains the author’s details.
Here’s an example of the configuration for an author file:
---
layout: author
name: John Doe
author_id: 3
email: example@yourdomain.com
bio: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt.
image: /assets/images/authors/author-pic.jpg
location: Sao Paulo, BR
---
You can also include optional fields like facebook, twitter, instagram, or reddit with their respective social links. These will be displayed in the author information area.
Once created, copy this HTML file into your _authors data folder. If you’ve already created an HTML file for a particular author, you can skip this step.