1×
Become a member
to unlock all features

Level Up!

Access all courses & lessons on egghead today and lock-in your price for life.

Autoplay

    Format Markdown Files for Gatsby.js

    Taylor BellTaylor Bell
    gatsbyGatsby
    ^2.0.0

    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.

    Code

    Code

    Become a Member to view code

    You must be a Member to view code

    Access all courses and lessons, track your progress, gain confidence and expertise.

    Become a Member
    and unlock code for this lesson
    Discuss

    Discuss

    Transcript

    Transcript

    Instructor: 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.

    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.

    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.