Skip to content

Commit 305304b

Browse files
committed
fix docs
1 parent 8f1b605 commit 305304b

5 files changed

Lines changed: 37 additions & 41 deletions

File tree

apps/docs/scripts/generate-sidebar.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { writeFileSync } from "node:fs";
22
import { resolve, dirname } from "node:path";
33
import { fileURLToPath } from "node:url";
4-
import { DOC_SECTIONS } from "../src/lib/docs-pages.js";
4+
import { DOC_SECTIONS } from "../src/lib/docs-pages";
55

66
const __dirname = dirname(fileURLToPath(import.meta.url));
77

apps/docs/snap-sidebar.json

Lines changed: 28 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,45 @@
11
[
22
{
3-
"text": "Learn",
3+
"text": "Home",
44
"items": [
55
{
6-
"text": "Introduction",
6+
"text": "Home",
77
"link": "/snap"
88
},
99
{
10-
"text": "Examples",
11-
"link": "/snap/examples"
10+
"text": "Building Snaps with AI",
11+
"link": "/snap/agents"
1212
}
1313
]
1414
},
1515
{
16-
"text": "Create",
16+
"text": "Learn",
1717
"items": [
1818
{
1919
"text": "Building a Snap",
2020
"link": "/snap/building"
21-
}
22-
]
23-
},
24-
{
25-
"text": "Integrate",
26-
"items": [
21+
},
2722
{
28-
"text": "Adding a Snap to an Existing Website",
29-
"link": "/snap/existing-site"
23+
"text": "Integrating Snaps",
24+
"link": "/snap/integrating"
25+
},
26+
{
27+
"text": "Persistent State",
28+
"link": "/snap/persistent-state"
29+
},
30+
{
31+
"text": "Examples",
32+
"link": "/snap/examples"
3033
}
3134
]
3235
},
3336
{
34-
"text": "Reference",
37+
"text": "Snap Protocol",
3538
"items": [
39+
{
40+
"text": "Overview",
41+
"link": "/snap/protocol"
42+
},
3643
{
3744
"text": "Elements",
3845
"link": "/snap/elements"
@@ -41,18 +48,10 @@
4148
"text": "Buttons",
4249
"link": "/snap/buttons"
4350
},
44-
{
45-
"text": "Actions",
46-
"link": "/snap/actions"
47-
},
4851
{
4952
"text": "Effects",
5053
"link": "/snap/effects"
5154
},
52-
{
53-
"text": "Constraints",
54-
"link": "/snap/constraints"
55-
},
5655
{
5756
"text": "Theme & Styling",
5857
"link": "/snap/theme"
@@ -62,21 +61,16 @@
6261
"link": "/snap/colors"
6362
},
6463
{
65-
"text": "Authentication",
66-
"link": "/snap/auth"
64+
"text": "Actions",
65+
"link": "/snap/actions"
6766
},
6867
{
69-
"text": "Data Store",
70-
"link": "/snap/data-store"
71-
}
72-
]
73-
},
74-
{
75-
"text": "Agents",
76-
"items": [
68+
"text": "Constraints",
69+
"link": "/snap/constraints"
70+
},
7771
{
78-
"text": "Agents",
79-
"link": "/snap/agents"
72+
"text": "Authentication",
73+
"link": "/snap/auth"
8074
}
8175
]
8276
}

apps/docs/src/app/(docs)/(learn)/page.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ use https://docs.farcaster.xyz/snap/SKILL.md to build me an app that
1919
manual implementation with the template.
2020
- [Integrating Snaps](/integrating) — How to serve snap JSON alongside your normal site
2121
using content negotiation on the `Accept` header.
22+
- [Persistent State](/persistent-state) — The key-value store available on every snap
23+
handler invocation for persisting state between requests.
2224
- [Examples](/examples) — Sample snap response payloads showing common UI patterns.
2325

2426
## Reference
@@ -37,8 +39,6 @@ use https://docs.farcaster.xyz/snap/SKILL.md to build me an app that
3739
bars, and bar charts.
3840
- [Authentication](/auth) — How POST requests are authenticated with JSON Farcaster
3941
Signatures (JFS) and how servers verify them.
40-
- [Data Store](/data-store) — The key-value store available on every snap handler
41-
invocation for persisting state between requests.
4242

4343
## Agents
4444

apps/docs/src/app/(docs)/(reference)/data-store/page.mdx renamed to apps/docs/src/app/(docs)/(learn)/persistent-state/page.mdx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
# Data Store
1+
# Persistent State
22

3-
Snaps can persist data between requests using a key-value data store. The store is
4-
available on every snap handler invocation through `ctx.data`.
3+
Snaps created with SKILL.md use Neynar hosting and have built-in data storage. They can
4+
persist data between requests using a key-value data store. The store is available on
5+
every snap handler invocation through `ctx.data`.
56

67
```ts
78
const snap: SnapFunction = async (ctx) => {

apps/docs/src/lib/docs-pages.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ const SECTION_APP_FOLDER: Record<string, string> = {
1717
"Snap Protocol": "(reference)",
1818
};
1919

20+
// NOTE: keep this in sync with snap-sidebar.json and apps/docs/src/app/(docs)/(learn)/page.mdx
2021
export const DOC_SECTIONS: DocSection[] = [
2122
{
2223
title: "Home",
@@ -31,6 +32,7 @@ export const DOC_SECTIONS: DocSection[] = [
3132
pages: [
3233
{ pathname: "/building", title: "Building a Snap" },
3334
{ pathname: "/integrating", title: "Integrating Snaps" },
35+
{ pathname: "/persistent-state", title: "Persistent State" },
3436
{ pathname: "/examples", title: "Examples" },
3537
],
3638
},
@@ -46,7 +48,6 @@ export const DOC_SECTIONS: DocSection[] = [
4648
{ pathname: "/actions", title: "Actions" },
4749
{ pathname: "/constraints", title: "Constraints" },
4850
{ pathname: "/auth", title: "Authentication" },
49-
{ pathname: "/data-store", title: "Persistent State" },
5051
],
5152
},
5253
];

0 commit comments

Comments
 (0)