Next.js powered blog with DatoCMS integration
This example showcases a Next.js Blog using DatoCMS as the data source. It supports Preview Mode with DatoCMS real-time updates. The purpose of this repository is to provide a quick start reference that can be set up easily.
Follow these steps to install and set up the theme:
.env.example file in the directory to .env.NEXT_DATOCMS_API_TOKEN in the .env file to the copied API token.NEXT_DATOCMS_PREVIEW_SECRET in the .env file to a random string (avoid spaces), e.g., MY_SECRET. This is used for Preview Mode.npm start or yarn start.To use the Preview Mode:
[Draft] in front of the title.http://localhost:3000/api/preview?secret=<NEXT_DATOCMS_PREVIEW_SECRET>&slug=<post-slug>
<NEXT_DATOCMS_PREVIEW_SECRET> should be the secret string you set for NEXT_DATOCMS_PREVIEW_SECRET in the .env file.<post-slug> should be the slug attribute of the post.This Next.js Blog example uses DatoCMS as the data source and fully supports Preview Mode with real-time updates. It provides a quick start reference for setting up the blog with easy installation steps. The integration with DatoCMS enables users to update post titles and preview the changes before publishing.