Skip to content

Commit

Permalink
Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
matjack1 committed Oct 23, 2020
1 parent 024f0d9 commit 5ea0f36
Show file tree
Hide file tree
Showing 6 changed files with 7,282 additions and 6,554 deletions.
12 changes: 0 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,8 @@ Have a look at the end result live:

### [https://next-blog-datocms.now.sh/](https://next-blog-datocms.now.sh/)


## How to use


### Quick start

1. [Create an account on DatoCMS](https://datocms.com).
Expand All @@ -26,12 +24,10 @@ Have a look at the end result live:

[![Deploy with DatoCMS](https://dashboard.datocms.com/deploy/button.svg)](https://dashboard.datocms.com/deploy?repo=datocms/nextjs-demo)


### Local setup

Once the setup of the project and repo is done, clone the repo locally.


#### Set up environment variables

In your DatoCMS' project, go to the **Settings** menu at the top and click **API tokens**.
Expand Down Expand Up @@ -61,16 +57,10 @@ NEXT_EXAMPLE_CMS_DATOCMS_PREVIEW_SECRET=...
```bash
npm install
npm run dev

# or

yarn install
yarn dev
```

Your blog should be up and running on [http://localhost:3000](http://localhost:3000)!


#### Try preview mode

On DatoCMS, go to one of the posts you've created and:
Expand All @@ -93,8 +83,6 @@ http://localhost:3000/api/preview?secret=<secret>&slug=<slug>

You should now be able to see the updated title. To exit the preview mode, you can click **Click here to exit preview mode** at the top.


#### Full guide

To read all the details and a long form guide, please check the original example on the [Next.js repo](https://github.com/zeit/next.js/tree/canary/examples/cms-datocms)

4 changes: 2 additions & 2 deletions datocms.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"previewImage": "https://www.datocms-assets.com/205/1584994498-screen-shot-2020-03-23-at-21-14-46-fullpage.png?crop=top&fit=crop&h=500&w=600&auto=format",
"datocmsProjectId": "23796",
"deploymentType": "static",
"buildCommand": "yarn build",
"buildCommand": "npm run build",
"datocmsApiTokenEnvName": "NEXT_EXAMPLE_CMS_DATOCMS_API_TOKEN",
"livePreviewUrl": "https://next-blog-datocms.now.sh/"
}
}
2 changes: 1 addition & 1 deletion netlify.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[build]
publish = "out"
command = "yarn export"
command = "npm run export"
Loading

0 comments on commit 5ea0f36

Please sign in to comment.