Overview
This product analysis provides a sample project showcasing the use of Next.js and microCMS. It demonstrates how to use Next.js’ getStaticProps and getStaticPaths to fetch data from microCMS and build static pages. The project is built using Next.js version 11.1.0, React version 17.0.1, and ReactDOM version 17.0.1.
Features
- Static Generation: The project utilizes Next.js’ getStaticProps and getStaticPaths functions to fetch data from microCMS and generate static pages.
- microCMS Integration: The project showcases how to integrate with microCMS to retrieve content model data.
- Environment Variables: The project demonstrates the use of environment variables by creating an .env.development.local file to store API keys and endpoints.
Installation
To install the theme and set up the project, follow these steps:
- Create a content model in microCMS by specifying the API name as “ブログ” and the endpoint as “blogsAPI”. Define a schema with a “title” field.
- Create an .env.development.local file to store the API key and endpoint obtained from microCMS.
- Launch the development server by running the application.
Summary
This product analysis presents a sample project that combines Next.js and microCMS. It showcases the usage of Next.js’ static generation capabilities along with microCMS integration to fetch and display content model data. The project also demonstrates the use of environment variables for storing sensitive information.