This article provides a demo and tutorial on how to add a simple comment section to a blog post using Next.js, Sanity.io, and Vercel. It guides the reader through the process of setting up the environment variables, running the front-end locally, and accessing the blog and Studio.
To set up the Next.js blog with comment section, follow these steps:
.env
file to store the necessary environment variables for Next.js and Sanity.io..env
file.Example .env
file:
SANITY_PROJECT_ID=xxxxxxxx
SANITY_API_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
SANITY_DATASET=production
Once the environment variables are set, the Next.js development server will be accessible at http://localhost:3000, and the Sanity Studio will be running at http://localhost:3333.
This article demonstrates how to add a comment section to a blog post using Next.js, Sanity.io, and Vercel. By following the provided steps, users are able to set up the necessary environment variables and run the Next.js development server locally. This tutorial provides a practical guide for integrating a comment section into a blog powered by Next.js and Sanity.io CMS.