Having error doing this although my syntax is correct

Checking your front matter

It looks like there may be some errors in your front matter. Take a look at your front matter and make sure the following is true:

  • You used dashes on the first and final line
  • You added a page title surrounded in quotes
  • You added a date using the correct format

The YAML front matter should be at the top of your blog post file and should look something like this:


title: “Your blog post title”
date: YYYY-MM-DD

Hi @imalinasahoo, welcome to the GitHub Support Community!

It looks like you may have posted a new topic instead of a reply to another post, is that right? If so, if you can let me know which topic you were replying to, I can merge this topic with the original.

If this isn’t the case, and you’re having trouble with one of your sites, can you give some more context to the trouble you’re having? A link to a repository that hosts your site would be very helpful!

Hello there, @thomasshaped. The link to my repository: https://github.com/imalinasahoo/github-pages-with-jekyll/pull/4
This problem says:

Step 6: Add blog post metadata

Now that you’ve created your Jekyll blog post file, we can add syntax to it. The syntax Jekyll files use is called YAML front matter. It goes at the top of your file and looks something like this:


title: “Welcome to my blog”
date: 2019-01-20

And doing this I get the error which says:

Checking your front matter

It looks like there may be some errors in your front matter. Take a look at your front matter and make sure the following is true:

  • You used dashes on the first and final line
  • You added a page title surrounded in quotes
  • You added a date using the correct format

The YAML front matter should be at the top of your blog post file and should look something like this:


title: “Your blog post title”
date: YYYY-MM-DD

I am unable to understand what went wrong with my code.

Thanks for posting that link!

It looks like you’ve added your front matter to the _config.yml file. You’ll need to remove it from there and add it to the start of your _posts/2020-09-19-my-first-blog.md markdown file instead. This adds the date and title metadata to your post instead of adding it to your entire site.

To fix this you’ll need to revert the changes you’ve made to your _config.yml file and add the following to the top of your blog post, filling out the date and title of your blog post:

---
title: "Your blog post title"
date: YYYY-MM-DD
---