rsnext/examples/cms-dotcms
Steven 4466ba436b
chore(examples): use default prettier for examples/templates (#60530)
## Description
This PR ensures that the default prettier config is used for examples
and templates.

This config is compatible with `prettier@3` as well (upgrading prettier
is bigger change that can be a future PR).

## Changes
- Updated `.prettierrc.json` in root with `"trailingComma": "es5"` (will
be needed upgrading to prettier@3)
- Added `examples/.prettierrc.json` with default config (this will
change every example)
- Added `packages/create-next-app/templates/.prettierrc.json` with
default config (this will change every template)

## Related

- Fixes #54402
- Closes #54409
2024-01-11 16:01:44 -07:00
..
components chore(examples): use default prettier for examples/templates (#60530) 2024-01-11 16:01:44 -07:00
lib chore(examples): use default prettier for examples/templates (#60530) 2024-01-11 16:01:44 -07:00
pages chore(examples): use default prettier for examples/templates (#60530) 2024-01-11 16:01:44 -07:00
public/favicon chore(examples): Add dotCMS example (#38214) 2022-10-01 15:26:13 +02:00
styles chore(examples): Add dotCMS example (#38214) 2022-10-01 15:26:13 +02:00
.env.local.example Lock experimental react version in tests (#41100) 2022-10-01 23:06:45 -07:00
.gitignore Add .yarn/install-state.gz to .gitignore (#56637) 2023-10-18 16:34:48 +00:00
next-env.d.ts Remove incorrect entries for pnpm debug log (#47241) 2023-03-26 22:26:05 -07:00
next.config.js chore(examples): use default prettier for examples/templates (#60530) 2024-01-11 16:01:44 -07:00
package.json chore(examples): address remaining review in dotCMS example (#41091) 2022-10-01 22:46:41 +02:00
postcss.config.js chore(examples): use default prettier for examples/templates (#60530) 2024-01-11 16:01:44 -07:00
README.md examples: Update Example Prepr CMS (#49224) 2023-08-14 07:13:50 -05:00
tailwind.config.js chore(examples): use default prettier for examples/templates (#60530) 2024-01-11 16:01:44 -07:00
tsconfig.json chore(examples): Add dotCMS example (#38214) 2022-10-01 15:26:13 +02:00

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.

Deploy with Vercel

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

Deploy with Vercel