rsnext/examples/cms-tina
leung018 66597be8a7
Add .yarn/install-state.gz to .gitignore (#56637)
### Reason for making this change
https://yarnpkg.com/getting-started/qa#:~:text=yarn%2Finstall%2Dstate.,your%20workspaces%20all%20over%20again.
In the official documentation of `yarn`, it is stated that `.yarn/install-state.gz` is an optimization file that developer shouldn't ever have to commit. However, currently, when running `create-next-app`, `.yarn/install-state.gz` is being commited.

### Remaining work
I apologize for only modifying one template initially to initiate the discussion first.

If this change is agreed upon,  it should be synchronized with other `.gitignore` templates. Would it be possible to follow a similar approach as in https://github.com/vercel/next.js/pull/47241? I would appreciate any assistance in syncing this change.
2023-10-18 16:34:48 +00:00
..
.tina Fixing Tina + Adding a demo URL (#35480) 2022-05-10 17:52:54 +00:00
_posts [examples] Add Tina CMS blog starter (#35045) 2022-03-05 17:08:49 +00:00
components Run next/link codemod for Next.js 13 on examples (#41913) 2022-10-30 21:00:45 +01:00
lib [examples] Add Tina CMS blog starter (#35045) 2022-03-05 17:08:49 +00:00
pages fix(cms-examples): title warning (#46262) 2023-02-23 15:21:03 +00:00
public [examples] Add Tina CMS blog starter (#35045) 2022-03-05 17:08:49 +00:00
styles [examples] Add Tina CMS blog starter (#35045) 2022-03-05 17:08:49 +00:00
.gitignore Add .yarn/install-state.gz to .gitignore (#56637) 2023-10-18 16:34:48 +00:00
package.json Update Examples to use React 18 (#42027) 2022-10-28 17:43:20 +00:00
postcss.config.js [examples] Add Tina CMS blog starter (#35045) 2022-03-05 17:08:49 +00:00
README.md chore(examples): Add dotCMS example (#38214) 2022-10-01 15:26:13 +02:00
tailwind.config.js [Docs] Add config types to all examples (#40083) 2022-08-31 16:41:22 -05:00

A statically generated blog example using Next.js and TinaCMS

This example showcases Next.js's Static Generation feature using TinaCMS as the CMS and editor.

This boilerplate demonstrates a basic usage and best practices. If you are looking for a more feature rich Tina experience with contextual editing. check out tina-cloud-starter.

Demo

https://cms-tina-example.vercel.app/

How to use

Execute create-next-app with npm, Yarn, or pnpm to bootstrap the example:

npx create-next-app --example cms-tina cms-tina-app
yarn create next-app --example cms-tina cms-tina-app
pnpm create next-app --example cms-tina cms-tina-app

Setp 1. Run Next.js in development mode

To get started, no configuration is needed for local development and editing.

npm install
npm run tina-dev

# or

yarn install
yarn tina-dev

Your blog should be up and running on http://localhost:3000! If it doesn't work, post on GitHub discussions.

Step 2. Editing blog posts.

Tina is git backed and uses markdown, JSON or MDX to power websites. To enter edit mode locally you just need to visit http://localhost:3000/admin

You can then select the collection "Blog Posts" and then the content you would like to edit.

Once you hit save, Tina will use our graphQL modify the content on your filesystem.

Step 4. Deploy on Vercel

You can deploy this app to the cloud with Vercel (Documentation).

Deploy Your Local Project

To deploy your local project to Vercel, push it to GitHub. Once you have pushed to GitHub, sign up for your Tina Cloud account at https://app.tina.io/register. Then follow the steps below:

  1. Select new project
  2. Select Import your site
  3. Follow steps to connect your GitHub repo.
  4. Copy your Client ID

Then import to Vercel.

Important: When you import your project on Vercel, make sure to click on Environment Variables and set NEXT_PUBLIC_TINA_CLIENT_ID to the client ID above.

Once you have successfully deployed to Vercel, go back to your Tina dashboard and under the project configuration enter the url in the Site URL(s) for example: https://cms-tina-example.vercel.app/