Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sanity-io/tutorial-sanity-blog-react-next
Front-end code for the Sanity, React, Next.js tutorial.
https://github.com/sanity-io/tutorial-sanity-blog-react-next
Last synced: 13 days ago
JSON representation
Front-end code for the Sanity, React, Next.js tutorial.
- Host: GitHub
- URL: https://github.com/sanity-io/tutorial-sanity-blog-react-next
- Owner: sanity-io
- Created: 2018-04-16T11:14:02.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-10-15T23:05:25.000Z (about 1 month ago)
- Last Synced: 2024-10-17T08:34:43.864Z (about 1 month ago)
- Language: TypeScript
- Homepage: https://www.sanity.io/blog/build-your-own-blog-with-sanity-and-next-js
- Size: 1.52 MB
- Stars: 140
- Watchers: 3
- Forks: 49
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Blogging with Sanity and Next.js
[Read the tutorial](https://www.sanity.io/blog/build-your-own-blog-with-sanity-and-next-js?utm_source=github&github_campaing=rbt)
## Get started
```sh
# Install the Sanity command line interface
~/
> npm i -g @sanity/cli# Initiate your own project in the studio folder
~/this-blog/studio
> sanity init# Add a CORS-origin rule to allow the frontend to request data
~/this-blog/studio
> sanity cors add http://localhost:3000 --no-credentials# Insert the projectId and dataset name from Sanity in client.js
~/this-blog/web
> nano client.js# Install frontend dependencies
~/this-blog/web
> npm install# Run Next.js in development mode
~/this-blog/web
> npm run dev
```## Deploy on vercel
```sh
~/this-blog/web
> npm i -g vercel
> vercel login
> vercel
```## Deploy as a static site on Netlify
[Read the tutorial](https://www.sanity.io/blog/tutorial-host-your-sanity-based-next-js-project-on-netlify?utm_source=github&utm_campaign=netlifyexport)
```sh
~/this-blog/web
npm run export
# exports your site as static files in /out
```