You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A streamlined starter template using [SvelteKit](https://kit.svelte.dev/) for the frontend and [Sanity](https://sanity.io/) for robust content management.
4
-
5
-

3
+
This template includes a [SvelteKit](https://svelte.dev/docs/kit/introduction) app with a [Sanity Studio](https://www.sanity.io/) – an open-source React application that connects to your Sanity project’s hosted dataset. The Studio is configured locally and can then be deployed for content collaboration.
6
4
7
5
## Features
8
6
9
-
* Fetch content seamlessly with [Sanity Content Lake](https://www.sanity.io/docs/datastore).
10
-
* Render beautiful block content using [Portable Text](https://www.sanity.io/docs/presenting-block-text).
11
-
* Manage and create content with the intuitive [Sanity Studio](https://www.sanity.io/docs/sanity-studio).
12
-
* Live visual editing through [Sanity's Presentation tools](https://www.sanity.io/docs/presentation).
13
-
* Advanced image cropping and rendering via [Sanity Image URLs](https://www.sanity.io/docs/image-url).
7
+
- Fetch content seamlessly with [Sanity Content Lake](https://www.sanity.io/docs/datastore).
8
+
- Render beautiful block content using [Portable Text](https://www.sanity.io/docs/presenting-block-text).
9
+
- Manage and create content with the intuitive [Sanity Studio](https://www.sanity.io/docs/sanity-studio).
10
+
- Live visual editing through [Sanity's Presentation tools](https://www.sanity.io/docs/presentation).
11
+
- Advanced image cropping and rendering via [Sanity Image URLs](https://www.sanity.io/docs/image-url).
14
12
15
13
## Demo
16
14
17
-
[Try the live demo](https://sanity-template-sveltekit-clean.sanity.build/)
This template includes a SvelteKit app and a Sanity Studio – an open-source React application that connects to your project’s hosted dataset. The Studio is configured locally and then deployed for content collaborators. Content and assets from the hosted dataset can be queried from Sanity’s APIs.
29
-
30
21
#### 1. Initialize template with Sanity CLI
31
22
32
23
Run the command in your Terminal to initialize this template on your local computer.
@@ -52,29 +43,32 @@ Open the SvelteKit app running locally in your browser on [http://localhost:5173
52
43
Open the Studio running locally in your browser on [http://localhost:3333](http://localhost:3333). You should now see a screen prompting you to log in to the Studio. Use the same service (Google, GitHub, or email) that you used when you logged in to the CLI.
53
44
54
45
### Adding content with Sanity
55
-
The template comes pre-defined with a schema containing a `Post` document type.
56
46
47
+
#### 1. Publish your first document
48
+
49
+
The template comes pre-defined with a schema containing a `Post` document type.
57
50
58
-
#### Publish your first document
59
51
From the Studio, click "+ Create" and select the `Post` document type. Go ahead and create and publish the document.
60
52
61
-
Your content should now appear in your SvelteKit app ([http://localhost:3000](http://localhost:3000)) as well as in the Studio on the "Presentation" Tab
53
+
Your content should now appear in your SvelteKit app ([http://localhost:5173](http://localhost:5173)) as well as in the Studio on the "Presentation" Tab
54
+
55
+
#### 2. Extending the Sanity schema
62
56
63
-
#### Extending the Sanity schema
64
57
The schema for the `Post` document type is defined in the `studio/src/schemaTypes/post.ts` file. You can [add more document types](https://www.sanity.io/docs/schema-types) to the schema to suit your needs.
65
58
66
59
### Deploying your application and inviting editors
67
-
Your SvelteKit frontend (`/sveltekit-app`) and Sanity Studio (`/studio`) are still only running on your local computer. It's time to deploy and get it into the hands of other content editors.
68
60
69
-
#### Deploy Sanity Studio
61
+
#### 1. Deploy Sanity Studio
62
+
63
+
Your SvelteKit frontend (`/sveltekit-app`) and Sanity Studio (`/studio`) are still only running on your local computer. It's time to deploy and get it into the hands of other content editors.
70
64
71
65
Back in your Studio directory (`/studio`), run the following command to deploy your Sanity Studio.
72
66
73
67
```shell
74
68
npx sanity deploy
75
69
```
76
70
77
-
#### Deploy SvelteKit app to Vercel
71
+
#### 2. Deploy SvelteKit app to Vercel
78
72
79
73
You have the freedom to deploy your SvelteKit app to your hosting provider of choice. With Vercel and GitHub being a popular choice, we'll cover the basics of that approach.
80
74
@@ -83,15 +77,15 @@ You have the freedom to deploy your SvelteKit app to your hosting provider of ch
83
77
3. Set the `Root Directory` to your SvelteKit app.
84
78
4. Configure your Environment Variables.
85
79
86
-
#### Invite a collaborator
80
+
#### 3. Invite a collaborator
81
+
87
82
Now that you’ve deployed your SvelteKit application and Sanity Studio, you can optionally invite a collaborator to your Studio. Open up [Manage](https://www.sanity.io/manage), select your project and click "Invite project members"
88
83
89
84
They will be able to access the deployed Studio, where you can collaborate together on creating content.
0 commit comments