-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5bc369c
commit 75b3ce9
Showing
18 changed files
with
271 additions
and
205 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,10 @@ | ||
SANITY_PROJECT_ID=6h1mv88x | ||
SANITY_DATASET=production | ||
SANITY_API_VERSION=2022-09-23 | ||
# These will be added to the window so the Studio can read them | ||
SANITY_PUBLIC_PROJECT_ID="6h1mv88x" | ||
SANITY_PUBLIC_DATASET="production" | ||
SANITY_PUBLIC_API_VERSION="2022-09-23" | ||
|
||
# A random string checked server-side to enable preview mode | ||
SANITY_PREVIEW_SECRET= | ||
|
||
# Generated in sanity.io/manage | ||
SANITY_READ_TOKEN= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,20 @@ | ||
export const projectDetails = () => ({ | ||
projectId: | ||
typeof document === 'undefined' ? process.env.SANITY_PROJECT_ID : window?.ENV?.projectId, | ||
dataset: typeof document === 'undefined' ? process.env.SANITY_DATASET : window?.ENV?.dataset, | ||
apiVersion: | ||
typeof document === 'undefined' ? process.env.SANITY_API_VERSION : window?.ENV?.apiVersion, | ||
}) | ||
declare global { | ||
interface Window { | ||
ENV: { | ||
SANITY_PUBLIC_PROJECT_ID: string | ||
SANITY_PUBLIC_DATASET: string | ||
SANITY_PUBLIC_API_VERSION: string | ||
} | ||
} | ||
} | ||
|
||
export const projectDetails = () => { | ||
const {SANITY_PUBLIC_PROJECT_ID, SANITY_PUBLIC_DATASET, SANITY_PUBLIC_API_VERSION} = | ||
typeof document === 'undefined' ? process.env : window.ENV | ||
|
||
return { | ||
projectId: SANITY_PUBLIC_PROJECT_ID ?? `pnkijp0b`, | ||
dataset: SANITY_PUBLIC_DATASET ?? `remix`, | ||
apiVersion: SANITY_PUBLIC_API_VERSION ?? `2022-09-23`, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import {defineConfig} from 'sanity' | ||
import {deskTool} from 'sanity/desk' | ||
|
||
import {projectDetails} from '~/sanity/projectDetails' | ||
import schema from '~/sanity/schema' | ||
|
||
export const config = defineConfig({ | ||
...projectDetails(), | ||
name: 'sanity-remix', | ||
title: 'Sanity Remix', | ||
plugins: [deskTool()], | ||
basePath: `/studio`, | ||
schema: { | ||
types: schema, | ||
}, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import {defineType, defineField} from 'sanity' | ||
|
||
export default defineType({ | ||
name: 'category', | ||
title: 'Category', | ||
type: 'document', | ||
fields: [ | ||
defineField({ | ||
name: 'title', | ||
type: 'string', | ||
}), | ||
defineField({ | ||
name: 'slug', | ||
type: 'slug', | ||
options: { | ||
source: 'title', | ||
}, | ||
}), | ||
], | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
import category from './category' | ||
import product from './product' | ||
|
||
export default [product] | ||
export default [product, category] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.