netlify-templates/nextjs-contentful-starter
À propos
Netlify Next.js and Contentful minimal starter.
Développement web et applicatifProgression mesurée des étoiles
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- 0
- in 1 month
- Historique en cours
Variations nettes sur des périodes qui se chevauchent, pas des totaux quotidiens. Les mesures absentes restent vides. Les étoiles indiquent l’intérêt, pas la qualité.
README.md
OriginalNext.js + Contentful Minimal Starter
A minimal starter for building websites with Next.js and Contentful CMS.
⚡ View demo: nextjs-contentful-starter.netlify.app
Prerequisites
Before you begin, please make sure you have the following:
- Netlify account
- Contentful account
- GitHub, GitLab or Bitbucket account
- Node v18+ or later
- (optional) nvm for Node version management.
Getting Started
Clone this repository
Fork and clone your repository, then run npm install in its root directory.
Create Contentful Space
After signing into Contentful, create a new space.
Generate Management Token
If you don't already have a management token (or personal access token), generate one. To do so, go into your new empty space, then:
- Click Settings
- Choose API Keys
- Select the Content management tokens tab
- Click the button to generate a new token

Generate Preview & Delivery API Keys
From the same place you generated the management token, you can now generate API access keys.
- Select the content delivery / preview tokens tab
- Choose Add API key
Set Environment Variables
In your project, duplicate .env.example to .env.
Fill in the values in the file based on the keys you've created.
Note: the Contentful space ID can be viewed and copied via Settings->General Settings in Contentful.
Import Content
Import the provided content models & content into Contentful by running the import.js script:
npm run import
If the import fails to run, make sure that you've run npm install and that all keys in your .env file are set correctly.
Run the Website
Run the Next.js development server:
npm run dev
Visit localhost:3000 and you should see the example content you imported into your new Contentful space.
Deploy to Netlify
To deploy your site to Netlify:
- Push your code to a Git repository (GitHub, GitLab, or Bitbucket)
- Log in to app.netlify.com
- Click "Import from Git" or "Add new site"
- Select your repository
- Configure your build settings:
- Build command:
npm run build - Publish directory:
.next
- Build command:
- Add your environment variables in the Netlify dashboard (Settings > Environment variables):
CONTENTFUL_SPACE_IDCONTENTFUL_DELIVERY_TOKENCONTENTFUL_PREVIEW_TOKEN
- Deploy your site
Next Steps
Here are a few suggestions on what to do next:
- Explore the Contentful documentation to learn more about content modeling
- Check out the Next.js documentation to understand the framework better
- Learn about Netlify deployment options
Support
If you get stuck along the way, get help in our support forums.
Explorer des projets similaires
Chargement…