Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to Sanity Studio v3 #2

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/dist
/node_modules
package-lock.json
.env*
.sanity
31 changes: 17 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
# Sanity Movies Content Studio
# Sanity CMS for 11tymeetup.dev

Congratulations, you have now installed the Sanity Content Studio, an open source real-time content editing environment connected to the Sanity backend.
This is the [Sanity CMS](https://www.sanity.io/) for [11tymeetup.dev](https://11tymeetup.dev).

Now you can do the following things:
## Local Development

- [Read “getting started” in the docs](https://www.sanity.io/docs/introduction/getting-started?utm_source=readme)
- Check out one of the example frontends: [React](https://github.com/sanity-io/example-frontend-next-js) | [React Native](https://github.com/sanity-io/example-app-react-native) | [Vue](https://github.com/sanity-io/example-frontend-vue-js) | [PHP](https://github.com/sanity-io/example-frontend-silex-twig)
- [Join the community Slack](https://slack.sanity.io/?utm_source=readme)
- [Extend and build plugins](https://www.sanity.io/docs/content-studio/extending?utm_source=readme)
1. Run `npm install` to install the dependencies.
1. If this is your first time running the project, [setup a new Sanity Studio project](https://www.sanity.io/learn/course/content-driven-web-application-foundations/create-a-new-sanity-project). Once you've
done that, create a `.env` file in the root of the project with the following content:

## Contributing
```env
SANITY_STUDIO_PROJECT_ID=your_project_id
```

Run `npm start` to start a local dev server for the studio. Commit all your changes to a branch and then create a pull request.
1. Run `npm run dev` to start the Sanity Studio locally.
1. Open [http://localhost:3333](http://localhost:3333) in your browser to view the Sanity Studio.

Once the changes are approved, merge them and then pull the changes to the `main` branch on your local machine. Then you'll need to login and deploy from your CLI:
## Contributing

```
$ sanity login
$ sanity deploy
```
1. Fork the repository.
1. Create a new branch for your changes.
1. Make your changes and commit them.
1. Push your changes to your fork.
1. Create a pull request to the main repository.
29 changes: 13 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,25 @@
"license": "UNLICENSED",
"scripts": {
"start": "sanity start",
"build": "sanity build"
"build": "sanity build",
"dev": "sanity dev"
},
"keywords": [
"sanity"
],
"dependencies": {
"@sanity/base": "^2.12.2",
"@sanity/components": "^2.2.6",
"@sanity/core": "^2.12.2",
"@sanity/default-layout": "^2.12.2",
"@sanity/default-login": "^2.11.1",
"@sanity/desk-tool": "^2.12.2",
"@sanity/google-maps-input": "^2.12.2",
"@sanity/rich-date-input": "^2.0.9",
"@sanity/vision": "^2.11.2",
"prop-types": "^15.7",
"react": "^17.0",
"react-dom": "^17.0",
"react-icons": "^3.11.0",
"sanity-plugin-markdown": "^2.0.2"
"@sanity/google-maps-input": "^4.1.0",
"@sanity/rich-date-input": "^3.0.5",
"@sanity/vision": "^3.79.0",
"easymde": "^2.20.0",
"prop-types": "^15.8.1",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"react-icons": "^5.5.0",
"sanity": "^3.79.0",
"sanity-plugin-markdown": "^5.1.0",
"styled-components": "^6.1.15"
},
"devDependencies": {},
"repository": {
"type": "git",
"url": "[email protected]:Eleventy-Meetup/website.git"
Expand Down
10 changes: 10 additions & 0 deletions sanity.cli.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { defineCliConfig } from "sanity/cli";

const config = {
api: {
projectId: process.env.SANITY_STUDIO_PROJECT_ID || "u9jnua2q",
dataset: "production",
},
};

export default defineCliConfig(config);
18 changes: 18 additions & 0 deletions sanity.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { defineConfig } from "sanity";
import { structureTool } from "sanity/structure";
import { richDate } from "@sanity/rich-date-input";
import { markdownSchema } from "sanity-plugin-markdown";
import { visionTool } from "@sanity/vision";
import schemas from "./schemas/schema";

const config = {
title: "Eleventy Meetup website",
projectId: import.meta.env.SANITY_STUDIO_PROJECT_ID || "u9jnua2q",
dataset: "production",
plugins: [structureTool(), richDate(), markdownSchema(), visionTool()],
schema: {
types: schemas,
},
};

export default defineConfig(config);
32 changes: 0 additions & 32 deletions sanity.json

This file was deleted.

2 changes: 1 addition & 1 deletion schemas/person.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import UserIcon from 'part:@sanity/base/user-icon'
import {UserIcon} from '@sanity/icons';

export default {
name: 'person',
Expand Down
35 changes: 11 additions & 24 deletions schemas/schema.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
// First, we must import the schema creator
import createSchema from 'part:@sanity/base/schema-creator'
// Then import schema types from any plugins that might expose them
import schemaTypes from 'all:part:@sanity/base/schema-type'
import richDate from 'part:@sanity/form-builder/input/rich-date/schema'

// We import object and document schemas
import blockContent from './blockContent'
import event from './event'
Expand All @@ -12,21 +6,14 @@ import person from './person'
import eventTalk from './eventTalk'

// Then we give our schema to the builder and provide the result to Sanity
export default createSchema({
// We name our schema
name: 'default',
// Then proceed to concatenate our document type
// to the ones provided by any plugins that are installed
types: schemaTypes.concat([
richDate,
// The following are document types which will appear
// in the studio.
event,
person,
talk,
// When added to this list, object types can be used as
// { type: 'typename' } in other document schemas
blockContent,
eventTalk,
]),
})
export default [
// The following are document types which will appear
// in the studio.
event,
person,
talk,
// When added to this list, object types can be used as
// { type: 'typename' } in other document schemas
blockContent,
eventTalk,
]