02.08.22: This post has been updated to use Next 12 and it's latest features.
Next.js is a React "metaframework" (a framework built on a framewo...
For further actions, you may consider blocking this person and/or reporting abuse
Hello!
I'm appreciating your app.
I could try a migration to your blog app.
However, after all migrations, sudden errors come out...
The matter is, I could not figure it out or fix it...
the errors come out after my all previous markdown posts migrations.
however, the funny thing is, last night when I complete all mitration and deploy on
'now', that was no problem at all.. but after a sleep,
sj-log.now.sh/
you can check the deployment was successful last night.
Do you have any idea of this?
Thank you!
Hi there! Not sure about this error. The finished sample repo is deployed fine for me on Netlify right now. Maybe make sure the build command is correct? It's hard to tell without more information!
Hey Kendall, I'm building my blog right now and found this useful, especially your finished product repo. Didn't know you needed an
exportPathMap
in the next.config.js so thanks for unblocking me.I ended up going with frontmatter-markdown-loader for md parsing and Netlify CMS for versioning: github.com/jplew/netlify-blog
Tina looks pretty cool might check it out.
Nice! Glad it was helpful. Yes that's a good point, I should follow up with notes on using exportPathMap βΊοΈ
How do you handle post ordering? Easiest I can think of is just prefixing every post filename with a date, but I don't really like adding meta data to the filename.
Another simple idea is adding the publication date as front matter and then sorting all posts when reading them. Might be a little slow though.
Any ideas?
Nice article!
Yeah I think both methods would work! Agree that the first would be simplest. I've implemented the latter on the tinacms.org site for the blog index if you wanna check it out. You can also see the pagination implementation there so you only render a certain number of posts per page.
Well explained!
I followed your tutorial in addition to this one: netlify.com/blog/2020/05/04/buildi...
I noticed that my code, the Netlify tutorial code and also yours have the same problem. If you open the development console of your browser and visit your site, you will see some 404 errors. The site works perfectly, but the errors are there! :-(
You can read more about issue that here loudnoises.us/solving-next-static-... and here github.com/zeit/now/issues/ 3294 but I can't solve it.
Do you have any idea about how to solve it?
You probably need to use getStaticPaths where you are implementing dynamic routes. (
exportPathMap
is now discouraged). Or there may be something funky going on with the parameters you are passing the routes. I would also look into the build command you are using for production. Just recently I changed from usingnext export
to justnext build
now that you can statically export at the page level withgetStaticProps
.Hey, Great Article ! Thanks so much...
One question though... if you are generating all Blog Post as static content at Building time, does it means that new Posts won't be shown until you Build again ?
Thanks !
Yeah that's correct! As far as I know, this is typical with JAMstack sites, when the content is updated the site will be rebuilt.
Great article! Thanks for writing.
Thank you so much