⚠️ This lesson is retired and might contain outdated information.

Format Markdown Files for Gatsby.js

Taylor Bell
InstructorTaylor Bell
Share this video with your friends

Social Share Links

Send Tweet

Gatsby looks at the “frontmatter” at the top of each Markdown file when building your blog. In this lesson, you’ll learn how to add necessary information for building your posts.

Instructor: [00:00] I'm in the My Blog directory, and I'm going to add a few posts. I'm going to do CD Source/Pages. Then, I like to do posts with the year, month, date, and a slug. I'll create a few of those. With those made, I'm going to create an index.md file in each one of the directories, which will be where our post is. With those made, let's go ahead and edit the first post.

[00:24] At the top of each post, we'll create some front matter, which is what will be used to create our posts. We'll add a few dashes. We'll start with a path. That'll be /firstpost. Then, we'll do a date.

[00:35] We'll do year, month, day. Add a title, add some tags, and a little excerpt. Then, close out our three dashes. Below this, we can start writing our post. Go ahead and follow this same pattern for all posts that you create.