Challenges

Server Rendering to Static Rendering

Convert Homepage Into Static

Let's convert our blog home page into a static page. To do that, simply replace the getServerSideProps function in the pages/index.js with the following:

export async function getStaticProps () {
  const postList = await githubCms.getPostList()

  return {
    props: {
      postList
    }
  }
}

Here we renamed getServerSideProps to getStaticProps. That's all we need.

Q: With this change, we removed a feature in our app, what's that?
authenticating...

šŸ™ We need your help

We need your help to keep maintain & add new content to this course. Here's how you can support us: