Skip to content

Commit 1786a0c

Browse files
authored
Merge pull request #82 from sanity-io/feat/seed-data
create script to generate seed data
2 parents e8e2a2c + 84d21f1 commit 1786a0c

File tree

12 files changed

+23141
-26981
lines changed

12 files changed

+23141
-26981
lines changed

README.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,42 @@ Read more about [Localization with Sanity in the docs](https://www.sanity.io/doc
1818

1919
![Course Platform Website](./img/course-platform-website.png)
2020

21+
## Link this to your own project
22+
23+
1. Clone the repository
24+
25+
```bash
26+
git clone https://github.com/sanity-io/course-platform.git
27+
```
28+
29+
2. Install dependencies in the root, `/studio` and `/web` folders
30+
31+
```bash
32+
pnpm install
33+
```
34+
35+
3. Create a new Sanity project and replace the `sanity.config.tsx` file with the following:
36+
37+
```bash
38+
npx sanity@latest init --env
39+
```
40+
41+
## Generate Seed Data
42+
43+
Import the seed data into Sanity:
44+
45+
```bash
46+
npx sanity dataset import seed-data.ndjson
47+
```
48+
49+
Seed data is generated in the `/studio` folder. You can modify the generation script `studio/scripts/generateSeedData.ts` to add or remove data as needed.
50+
51+
Run the following command to generate new seed data:
52+
53+
```bash
54+
npm run generate-seed
55+
```
56+
2157
## Schema
2258

2359
Each schema contains a unique strategy:

0 commit comments

Comments
 (0)