Unverified Commit 22c0b65e authored by James Perkins's avatar James Perkins Committed by GitHub

Fixing Tina + Adding a demo URL (#35480)

## Documentation / Examples

- Updating Tina Demo URL
- Adding Tina to blog-starter example
- Adding Tina to Basic features section
- Updating Tina to actually work again
parent 8f9296c0
......@@ -64,6 +64,7 @@ You can also use **Client-side Rendering** along with Static Generation or Serve
<li><a href="https://github.com/vercel/next.js/tree/canary/examples/cms-graphcms">GraphCMS Example</a> (<a href="https://next-blog-graphcms.vercel.app/">Demo</a>)</li>
<li><a href="https://github.com/vercel/next.js/tree/canary/examples/cms-kontent">Kontent Example</a> (<a href="https://next-blog-kontent.vercel.app/">Demo</a>)</li>
<li><a href="https://github.com/vercel/next.js/tree/canary/examples/cms-builder-io">Builder.io Example</a> (<a href="https://cms-builder-io.vercel.app/">Demo</a>)</li>
<li><a href="https://github.com/vercel/next.js/tree/canary/examples/cms-tina">TinaCMS Example</a> (<a href="https://cms-tina-example.vercel.app/">Demo</a>)</li>
<li><a href="https://static-tweet.vercel.app/">Static Tweet (Demo)</a></li>
</ul>
</details>
......
......@@ -33,6 +33,7 @@ Deploy the example using [Vercel](https://vercel.com?utm_source=github&utm_mediu
- [Kontent](/examples/cms-kontent)
- [Umbraco Heartcore](/examples/cms-umbraco-heartcore)
- [Builder.io](/examples/cms-builder-io)
- [TinaCMS](/examples/cms-tina/)
## How to use
......
......@@ -4,22 +4,19 @@
"resolveType": "multiCollectionDocumentList",
"collections": ["posts"]
},
"Node": {
"type": "Node",
"resolveType": "nodeDocument"
},
"Node": { "type": "Node", "resolveType": "nodeDocument" },
"DocumentNode": {
"type": "DocumentNode",
"resolveType": "multiCollectionDocument",
"createDocument": "create",
"updateDocument": "update"
},
"PostsDocument": {
"type": "PostsDocument",
"Posts": {
"type": "Posts",
"resolveType": "collectionDocument",
"collection": "posts",
"createPostsDocument": "create",
"updatePostsDocument": "update"
"createPosts": "create",
"updatePosts": "update"
},
"PostsConnection": {
"type": "PostsConnection",
......
{
"version": {
"fullVersion": "0.59.7",
"fullVersion": "0.60.1",
"major": "0",
"minor": "59",
"patch": "7"
"minor": "60",
"patch": "1"
},
"meta": {},
"collections": [
......@@ -75,9 +75,7 @@
"label": "Blog Post Body",
"name": "body",
"isBody": true,
"ui": {
"component": "textarea"
},
"ui": { "component": "textarea" },
"namespace": ["posts", "body"]
}
],
......
query getPostsDocument($relativePath: String!) {
getPostsDocument(relativePath: $relativePath) {
sys {
query posts($relativePath: String!) {
posts(relativePath: $relativePath) {
_sys {
filename
basename
breadcrumbs
......@@ -9,19 +9,17 @@ query getPostsDocument($relativePath: String!) {
extension
}
id
data {
...PostsParts
}
...PostsParts
}
}
query getPostsList {
getPostsList {
query postsConnection {
postsConnection {
totalCount
edges {
node {
id
sys {
_sys {
filename
basename
breadcrumbs
......@@ -29,9 +27,7 @@ query getPostsList {
relativePath
extension
}
data {
...PostsParts
}
...PostsParts
}
}
}
......
......@@ -38,10 +38,9 @@ interface Node {
"""
interface Document {
sys: SystemInfo
id: ID!
form: JSON!
values: JSON!
_sys: SystemInfo
_values: JSON!
}
"""
......@@ -49,36 +48,32 @@ A relay-compliant pagination connection
"""
interface Connection {
totalCount: Float!
pageInfo: PageInfo!
}
type Query {
getCollection(collection: String): Collection!
getCollections: [Collection!]!
getOptimizedQuery(queryString: String!): String
collection(collection: String): Collection!
collections: [Collection!]!
node(id: String): Node!
getDocument(collection: String, relativePath: String): DocumentNode!
getDocumentList(
before: String
after: String
first: Float
last: Float
): DocumentConnection!
getDocumentFields: JSON!
getPostsDocument(relativePath: String): PostsDocument!
getPostsList(
document(collection: String, relativePath: String): DocumentNode!
posts(relativePath: String): Posts!
postsConnection(
before: String
after: String
first: Float
last: Float
sort: String
): PostsConnection!
}
type DocumentConnectionEdges {
cursor: String
cursor: String!
node: DocumentNode
}
type DocumentConnection implements Connection {
pageInfo: PageInfo
pageInfo: PageInfo!
totalCount: Float!
edges: [DocumentConnectionEdges]
}
......@@ -97,10 +92,11 @@ type Collection {
after: String
first: Float
last: Float
sort: String
): DocumentConnection!
}
union DocumentNode = PostsDocument
union DocumentNode = Posts
type PostsAuthor {
name: String
......@@ -111,7 +107,7 @@ type PostsOgImage {
url: String
}
type Posts {
type Posts implements Node & Document {
title: String
excerpt: String
coverImage: String
......@@ -119,24 +115,18 @@ type Posts {
author: PostsAuthor
ogImage: PostsOgImage
body: String
}
type PostsDocument implements Node & Document {
id: ID!
sys: SystemInfo!
data: Posts!
form: JSON!
values: JSON!
dataJSON: JSON!
_sys: SystemInfo!
_values: JSON!
}
type PostsConnectionEdges {
cursor: String
node: PostsDocument
cursor: String!
node: Posts
}
type PostsConnection implements Connection {
pageInfo: PageInfo
pageInfo: PageInfo!
totalCount: Float!
edges: [PostsConnectionEdges]
}
......@@ -152,19 +142,14 @@ type Mutation {
relativePath: String!
params: DocumentMutation!
): DocumentNode!
deleteDocument(collection: String, relativePath: String!): DocumentNode!
createDocument(
collection: String
relativePath: String!
params: DocumentMutation!
): DocumentNode!
updatePostsDocument(
relativePath: String!
params: PostsMutation!
): PostsDocument!
createPostsDocument(
relativePath: String!
params: PostsMutation!
): PostsDocument!
updatePosts(relativePath: String!, params: PostsMutation!): Posts!
createPosts(relativePath: String!, params: PostsMutation!): Posts!
}
input DocumentMutation {
......
import { defineSchema, defineConfig } from 'tinacms'
export default defineSchema({
const schema = defineSchema({
collections: [
{
label: 'Blog Posts',
......@@ -69,7 +69,7 @@ export default defineSchema({
},
],
})
export default schema
// Your tina config
// ==============
const branch = 'main'
......@@ -82,6 +82,7 @@ const apiURL =
export const tinaConfig = defineConfig({
apiURL,
schema,
cmsCallback: (cms) => {
// add your CMS callback code here (if you want)
......
......@@ -5,6 +5,10 @@ This example showcases Next.js's [Static Generation](https://nextjs.org/docs/bas
> 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](https://github.com/tinacms/tina-cloud-start/git).
## Demo
### [https://cms-tina-example.vercel.app/](https://cms-tina-example.vercel.app/)
### Related examples
- [WordPress](/examples/cms-wordpress)
......@@ -30,9 +34,9 @@ Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packag
```bash
npx create-next-app --example cms-tina cms-tina-app
# or
yarn create next-app --example cms-ghost cms-tina-app
yarn create next-app --example cms-tina cms-tina-app
# or
pnpm create next-app -- --example cms-ghost cms-tina-app
pnpm create next-app -- --example cms-tina cms-tina-app
```
### Setp 1. Run Next.js in development mode
......@@ -76,4 +80,4 @@ Then [import to Vercel](https://vercel.com/import/git?utm_source=github&utm_medi
**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://tina-cms.vercel.app.
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/
......@@ -9,7 +9,7 @@
"tina-start": "yarn tinacms server:start -c \"next start\""
},
"dependencies": {
"@tinacms/cli": "^0.60.8",
"@tinacms/cli": "^0.60.16",
"classnames": "2.3.1",
"date-fns": "2.28.0",
"gray-matter": "4.0.3",
......@@ -19,7 +19,7 @@
"remark": "14.0.2",
"remark-html": "15.0.1",
"styled-components": "^5.3.3",
"tinacms": "^0.66.7"
"tinacms": "^0.68.4"
},
"devDependencies": {
"autoprefixer": "^10.4.2",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment