Skip to content

Commit cfb8d05

Browse files
committed
init
1 parent 0ec05ae commit cfb8d05

15 files changed

+8358
-0
lines changed

config/.checksums

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"#": "Used by Sanity to keep track of configuration file checksums, do not delete or modify!",
3+
"@sanity/default-layout": "bb034f391ba508a6ca8cd971967cbedeb131c4d19b17b28a0895f32db5d568ea",
4+
"@sanity/default-login": "6fb6d3800aa71346e1b84d95bbcaa287879456f2922372bb0294e30b968cd37f",
5+
"@sanity/form-builder": "b38478227ba5e22c91981da4b53436df22e48ff25238a55a973ed620be5068aa",
6+
"@sanity/data-aspects": "d199e2c199b3e26cd28b68dc84d7fc01c9186bf5089580f2e2446994d36b3cb6"
7+
}

config/@sanity/data-aspects.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"listOptions": {}
3+
}

config/@sanity/default-layout.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"toolSwitcher": {
3+
"order": [],
4+
"hidden": []
5+
}
6+
}

config/@sanity/default-login.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"providers": {
3+
"mode": "append",
4+
"redirectOnSingle": false,
5+
"entries": []
6+
}
7+
}

config/@sanity/form-builder.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"images": {
3+
"directUploads": true
4+
}
5+
}

now.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"version": 2,
3+
"routes": [
4+
{ "handle": "filesystem" },
5+
{ "src": "/.*", "dest": "/index.html" }
6+
]
7+
}

package.json

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"name": "sanity-cms",
3+
"private": true,
4+
"version": "1.0.0",
5+
"description": "",
6+
"main": "package.json",
7+
"author": "Fedor Parfenov <[email protected]>",
8+
"license": "UNLICENSED",
9+
"scripts": {
10+
"start": "sanity start",
11+
"test": "sanity check",
12+
"build": "sanity build public -y"
13+
},
14+
"keywords": [
15+
"sanity"
16+
],
17+
"dependencies": {
18+
"@sanity/base": "^1.149.15",
19+
"@sanity/components": "^1.149.15",
20+
"@sanity/core": "^1.149.13",
21+
"@sanity/default-layout": "^1.149.15",
22+
"@sanity/default-login": "^1.149.11",
23+
"@sanity/desk-tool": "^1.149.15",
24+
"@sanity/production-preview": "^1.149.0",
25+
"@sanity/vision": "^1.149.0",
26+
"prop-types": "^15.6",
27+
"react": "^16.2",
28+
"react-dom": "^16.2"
29+
},
30+
"devDependencies": {
31+
"@sanity/cli": "^1.149.13"
32+
}
33+
}

plugins/.gitkeep

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
User-specific packages can be placed here

resolveProductionUrl.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
const previewSecret = 'preview-time' // Copy the string you used for NEXT_EXAMPLE_CMS_SANITY_PREVIEW_SECRET
2+
const projectUrl = 'http://localhost:3000'
3+
4+
export default function resolveProductionUrl(document) {
5+
return `${projectUrl}/api/preview?secret=${previewSecret}&slug=${document.slug.current}`
6+
}

sanity.json

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"root": true,
3+
"project": {
4+
"name": "sanity-cms"
5+
},
6+
"api": {
7+
"projectId": "wbdlyz23",
8+
"dataset": "production"
9+
},
10+
"plugins": [
11+
"@sanity/base",
12+
"@sanity/components",
13+
"@sanity/default-layout",
14+
"@sanity/default-login",
15+
"@sanity/desk-tool",
16+
"@sanity/production-preview"
17+
],
18+
"env": {
19+
"development": {
20+
"plugins": [
21+
"@sanity/vision"
22+
]
23+
}
24+
},
25+
"parts": [
26+
{
27+
"name": "part:@sanity/base/schema",
28+
"path": "./schemas/schema"
29+
},
30+
{
31+
"implements": "part:@sanity/production-preview/resolve-production-url",
32+
"path": "./resolveProductionUrl.js"
33+
}
34+
]
35+
}

schemas/schema.js

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
// First, we must import the schema creator
2+
import createSchema from 'part:@sanity/base/schema-creator'
3+
4+
// Then import schema types from any plugins that might expose them
5+
import schemaTypes from 'all:part:@sanity/base/schema-type'
6+
7+
// Then we give our schema to the builder and provide the result to Sanity
8+
export default createSchema({
9+
// We name our schema
10+
name: 'default',
11+
// Then proceed to concatenate our document type
12+
// to the ones provided by any plugins that are installed
13+
types: schemaTypes.concat([
14+
/* Your types here! */
15+
{
16+
name: 'author',
17+
type: 'document',
18+
title: 'Author',
19+
fields: [
20+
{
21+
name: 'name',
22+
title: 'Name',
23+
type: 'string',
24+
},
25+
{
26+
name: 'picture',
27+
title: 'Picture',
28+
type: 'image',
29+
},
30+
],
31+
},
32+
33+
{
34+
name: 'post',
35+
type: 'document',
36+
title: 'Post',
37+
fields: [
38+
{
39+
name: 'title',
40+
title: 'Title',
41+
type: 'string',
42+
},
43+
{
44+
name: 'content',
45+
title: 'Content',
46+
type: 'array',
47+
of: [{ type: 'block' }],
48+
},
49+
{
50+
name: 'excerpt',
51+
title: 'Excerpt',
52+
type: 'string',
53+
},
54+
{
55+
name: 'coverImage',
56+
title: 'Cover Image',
57+
type: 'image',
58+
},
59+
{
60+
name: 'date',
61+
title: 'Date',
62+
type: 'datetime',
63+
},
64+
{
65+
name: 'author',
66+
title: 'Author',
67+
type: 'reference',
68+
to: [{ type: 'author' }],
69+
},
70+
{
71+
name: 'slug',
72+
title: 'Slug',
73+
type: 'slug',
74+
},
75+
],
76+
},
77+
]),
78+
})

static/.gitkeep

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Files placed here will be served by the Sanity server under the `/static`-prefix

static/favicon.ico

1.12 KB
Binary file not shown.

tsconfig.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"include": ["./node_modules/@sanity/base/types/**/*.ts", "./**/*.ts", "./**/*.tsx"]
3+
}

0 commit comments

Comments
 (0)