41019c2314
This PR updates the `cms-sanity` example to use: - App Router - TypeScript - Sanity Studio v3 instead of v2 - Embeds the Studio inside the next app on the `/studio` route. - ISR / Data Cache (revalidations through `revalidatePath` while in Live Visual Editing, time-based to match the Sanity API CDN in production). - Support Vercel Visual Editing out of the box. - The new `next-sanity/image` component. - Vercel Speed Insights. - The Sanity Presentation Tool for live content previews. - Sanity Portable Text setup to fully support `@tailwindcss/typography`. - [AI Assist](https://www.sanity.io/docs/ai-assist) - Auto fill in `alt` text on images. - Preset prompts for content creation |
||
---|---|---|
.. | ||
components | ||
lib | ||
pages | ||
public/favicon | ||
styles | ||
.env.local.example | ||
.gitignore | ||
next-env.d.ts | ||
next.config.js | ||
package.json | ||
postcss.config.js | ||
README.md | ||
tailwind.config.js | ||
tsconfig.json |
A statically generated blog example using Next.js and dotCMS
This example showcases Next.js's Static Generation feature using dotCMS as the data source.
Demo
https://nextjs-dotcms-blog.vercel.app/
Deploy your own
Using the Deploy Button below, you'll deploy the Next.js project.
Related examples
- AgilityCMS
- Builder.io
- ButterCMS
- Contentful
- Cosmic
- DatoCMS
- DotCMS
- Drupal
- Enterspeed
- Ghost
- GraphCMS
- Kontent
- Prepr
- Prismic
- Sanity
- Sitefinity
- Storyblok
- TakeShape
- Umbraco heartcore
- Webiny
- Blog Starter
- WordPress
How to use
Rename .env.local.example
to .env.local
and complete the variables:
NEXT_PUBLIC_DOTCMS_HOST
is the dotCMS host, you can use https://demo.dotcms.com
DOTCMS_TOKEN
for the demo site, you can generate the token using:
curl -H "Content-Type:application/json" --insecure -X POST -d '
{ "user":"admin@dotcms.com", "password":"admin", "expirationDays": 10 }
' http://demo.dotcms.com:8080/api/v1/authentication/api-token
Execute create-next-app
with npm, Yarn, or pnpm to bootstrap the example:
npx create-next-app --example cms-dotcms cms-dotcms-app
# or
yarn create next-app --example cms-dotcms cms-dotcms-app
# or
pnpm create next-app --example cms-dotcms cms-dotcms-app