DEV Community

Discussion on: How to Make a Markdown Blog With Next.js

Collapse
 
valkiriann profile image
Ana Enríquez • Edited

Hi Jose !

Thanks a lot for your article. I was following the steps and I got into some issues.

The first one is when you create the post and then write the index.js for the first time. I ran into an error because in the code you search for "date" and not for "updatedAt" for the date of the post.

I fixed that by changing the name of the property in the markdown files but maybe you want to edit the tutorial too.

My second problem is that I am stuck in the part of creating the layout component. I created the file layout.js under a components folder but I dont know how to link it in my index and I am getting an error because Layout is not defined.

I think I am missing a step.

I dont know nothing about react so maybe it is something very easy but I am afraid I cant continue. Could you help me?

Collapse
 
joserfelix profile image
Jose Felix

Hi Ana! Thanks for pointing out about the date. I have fixed it accordingly.

You are missing the layout because you haven't imported it. At the top of your file add:

import Layout from "../components/Layout";

Let me know if it worked. Cheers 😎

Collapse
 
valkiriann profile image
Ana Enríquez

Hi Jose, thanks for your quick reply! I have now finished the tutorial, thanks again for posting it. I have found some more issues but searching in google I was able to resolve it.

  • some more imports where missing in the code samples:

in typography.js was missing the typography const

const typography = new Typography(SutroTheme)

In [slug].js was also missing the Layout import
In the _app.js you imported typeface-lato but that typography was not installed, only the ones for sutro. so I had to install it with npm.

Those were simple things that with a little of inspection to the code and googling how to import in react I was able to solve but I you add it to the tutorial I think it would be perfect !!

thanks again for the guide :).

Thread Thread
 
joserfelix profile image
Jose Felix

I'm glad you liked the tutorial 🙌. Thanks for making the blog post better, I really appreciate it! I have fixed all these accordingly.