netlify-templates / nextjs-blog-theme

A customizable Next.js and Tailwind blog starter. Designed by the Bejamas agency.

Home Page:https://bejamas-nextjs-blog.netlify.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add example of frontmatter keys needed for new post

maxcell opened this issue · comments

Given a conversation within the Jamstack Discord, I think it is important for us to document what is needed for a new post so users can easily get running. An easy lift would be putting this into the README. Enough there to solve awareness.


As an aside, I wonder if there is any way for us to essentially throw a more helpful error around if the front matter wasn't properly setup so that folks get insights on "oh hey, you're missing a front matter key, be sure to add this". Rather than:

5:08:12 PM: Error occurred prerendering page "/posts/test-post". Read more: https://nextjs.org/docs/messages/prerender-error
5:08:12 PM: Error: Error serializing `.prevPost.title` returned from `getStaticProps` in "/posts/[slug]".
5:08:12 PM: Reason: `undefined` cannot be serialized as JSON. Please use `null` or omit this value.