Skip to content

Commit

Permalink
feat: add secondary staging workspace (#54)
Browse files Browse the repository at this point in the history
* chore: upgrade sanity

* feat: add staging workspace
  • Loading branch information
blushi authored Dec 19, 2023
1 parent c7c2659 commit 45c162d
Show file tree
Hide file tree
Showing 3 changed files with 945 additions and 806 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"prop-types": "^15.8.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"sanity": "^3.8.3",
"sanity": "^3.20.1",
"styled-components": "^5.2.0"
},
"devDependencies": {
Expand Down
28 changes: 24 additions & 4 deletions sanity.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ import schemas from './schemas/schema';
import deskStructure from './deskStructure';
import { uniqueDocuments } from './uniqueDocuments';

export default defineConfig({
title: 'regen-sanity',
const config = {
projectId: process.env.SANITY_STUDIO_PROJECT_ID,
dataset: process.env.SANITY_STUDIO_DATASET,
plugins: [
deskTool({
structure: deskStructure,
Expand Down Expand Up @@ -36,4 +34,26 @@ export default defineConfig({
return prev;
},
},
});
};

export default defineConfig([
{
title: 'regen-sanity',
// The default dataset will be set to production in the deployed studio (see .env.production)
// but it will usually be staging in local dev for easier access.
dataset: process.env.SANITY_STUDIO_DATASET,
name: 'default-workspace',
basePath: '/default',
...config,
},
{
title: 'regen-sanity-staging',
// The secondary workspace always uses the staging dataset.
// This is primarily useful for content editors to edit content on staging
// from the deployed studio when needed.
dataset: 'staging',
name: 'staging-workspace',
basePath: '/staging',
...config,
}
]);
Loading

0 comments on commit 45c162d

Please sign in to comment.