Overview
This article provides instructions for setting up Content Previews, a demo app for the Content Previews course on the Learning Center. The article lists the requirements, provides step-by-step instructions for installation, and explains how to set up content previews on the Contentful web app.
Features
- Node.js: The app requires Node.js to be installed on the computer.
- Contentful API keys: The user needs to create an empty space in Contentful and note the API keys, including delivery, preview, and management keys.
Installation
Follow these steps to install the theme:
- Create an empty space in Contentful and note the API keys (delivery, preview, and management).
- Download the repository and open the project’s location on your computer.
- Run the following command in your terminal to install the dependencies:
npm install - After installing the dependencies, run the following command to configure the app and enter the API keys when prompted:
npm run setup - Run the app with the following command:
npm run dev - Open the link http://localhost:9009/ in your browser.
To set up content previews on the Contentful web app:
- Go to SPACE SETTINGS > Content preview.
- Set up preview for the Post content model and use a URL like the following:
http://localhost:9009/api/preview?secret=your-preview-secret&slug={entry.fields.slug}
Summary
This article provides instructions for setting up Content Previews, a demo app for the Content Previews course on the Learning Center. It explains the requirements, installation process, and how to set up content previews on the Contentful web app.