@riverbankcms/sdk 0.7.0 → 0.7.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +229 -0
- package/dist/cli/index.js +42 -95
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/init-docs/content/agents-section.md +50 -0
- package/dist/cli/init-docs/content/cli-reference.md +574 -0
- package/dist/cli/init-docs/content/content-management.md +384 -0
- package/dist/cli/init-docs/content/context-brand.md +125 -0
- package/dist/cli/init-docs/content/context-brief.md +77 -0
- package/dist/cli/init-docs/content/context-knowledge.md +111 -0
- package/dist/cli/init-docs/content/getting-started.md +130 -0
- package/dist/cli/init-docs/content/site-workflows-readme.md +96 -0
- package/dist/cli/init-docs/content/workflow-add-block.md +228 -0
- package/dist/cli/init-docs/content/workflow-create-page.md +193 -0
- package/dist/cli/init-docs/content/workflow-publish.md +280 -0
- package/dist/client/bookings.d.mts +2 -0
- package/dist/client/bookings.d.ts +2 -0
- package/dist/client/bookings.js +2956 -104
- package/dist/client/bookings.js.map +1 -1
- package/dist/client/bookings.mjs +2929 -70
- package/dist/client/bookings.mjs.map +1 -1
- package/dist/client/client.d.mts +2 -2
- package/dist/client/client.d.ts +2 -2
- package/dist/client/client.js +602 -68
- package/dist/client/client.js.map +1 -1
- package/dist/client/client.mjs +602 -68
- package/dist/client/client.mjs.map +1 -1
- package/dist/client/hooks.d.mts +2 -2
- package/dist/client/hooks.d.ts +2 -2
- package/dist/client/rendering/client.js +3070 -259
- package/dist/client/rendering/client.js.map +1 -1
- package/dist/client/rendering/client.mjs +3212 -395
- package/dist/client/rendering/client.mjs.map +1 -1
- package/dist/client/spam-protection.d.mts +55 -0
- package/dist/client/spam-protection.d.ts +55 -0
- package/dist/client/spam-protection.js +2915 -0
- package/dist/client/spam-protection.js.map +1 -0
- package/dist/client/spam-protection.mjs +2893 -0
- package/dist/client/spam-protection.mjs.map +1 -0
- package/dist/client/{usePage-BiOReg0_.d.ts → usePage-BYmJCCm1.d.ts} +132 -11
- package/dist/client/{usePage-BXjk8BhD.d.mts → usePage-DZtrWajy.d.mts} +132 -11
- package/dist/server/{Layout-wBtJLTVX.d.ts → Layout-Yluyb6sK.d.ts} +1 -1
- package/dist/server/{Layout-B7cvis7r.d.mts → Layout-qWLdVm5-.d.mts} +1 -1
- package/dist/server/chunk-2IZ6S225.js +122 -0
- package/dist/server/chunk-2IZ6S225.js.map +1 -0
- package/dist/server/chunk-4CV4JOE5.js +27 -0
- package/dist/server/chunk-4CV4JOE5.js.map +1 -0
- package/dist/server/chunk-5LRR64Y6.mjs +72 -0
- package/dist/server/chunk-5LRR64Y6.mjs.map +1 -0
- package/dist/server/chunk-NBTRDLCM.js +72 -0
- package/dist/server/chunk-NBTRDLCM.js.map +1 -0
- package/dist/server/chunk-NFEGQTCC.mjs +27 -0
- package/dist/server/{chunk-7FIJSGHU.mjs → chunk-NFQLH5IA.mjs} +856 -74
- package/dist/server/chunk-NFQLH5IA.mjs.map +1 -0
- package/dist/server/chunk-PPHZV6YD.mjs +122 -0
- package/dist/server/chunk-PPHZV6YD.mjs.map +1 -0
- package/dist/server/{chunk-P7UVAMK6.js → chunk-VLXTNB2C.js} +866 -84
- package/dist/server/chunk-VLXTNB2C.js.map +1 -0
- package/dist/server/{components-CMMwDXTW.d.mts → components-DNHfSCML.d.mts} +3 -3
- package/dist/server/{components-CICSJyp_.d.ts → components-Di5ME6He.d.ts} +3 -3
- package/dist/server/components.d.mts +5 -5
- package/dist/server/components.d.ts +5 -5
- package/dist/server/components.js +1 -1
- package/dist/server/components.mjs +1 -1
- package/dist/server/config-validation.js +1 -1
- package/dist/server/config-validation.mjs +1 -1
- package/dist/server/config.js +1 -1
- package/dist/server/config.mjs +1 -1
- package/dist/server/data.d.mts +2 -2
- package/dist/server/data.d.ts +2 -2
- package/dist/server/data.js +1 -1
- package/dist/server/data.mjs +1 -1
- package/dist/server/env.d.mts +109 -0
- package/dist/server/env.d.ts +109 -0
- package/dist/server/env.js +14 -0
- package/dist/server/env.js.map +1 -0
- package/dist/server/env.mjs +14 -0
- package/dist/server/{index-DI_qlYx3.d.mts → index--Oyunk_B.d.mts} +2 -2
- package/dist/server/{index-BTwWvSBu.d.ts → index-C9Ra8dza.d.ts} +2 -2
- package/dist/server/{index-Bucs6UqG.d.mts → index-Clm3skz_.d.mts} +1 -1
- package/dist/server/{index-Cp7tJuRt.d.ts → index-DLvNddi-.d.ts} +1 -1
- package/dist/server/index.d.mts +216 -5
- package/dist/server/index.d.ts +216 -5
- package/dist/server/index.js +301 -4
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +301 -4
- package/dist/server/index.mjs.map +1 -1
- package/dist/server/{loadContent-DmgpFcFC.d.ts → loadContent-D7LQwI0o.d.ts} +3 -3
- package/dist/server/{loadContent-C-YYUKQa.d.mts → loadContent-DVfuBLiZ.d.mts} +3 -3
- package/dist/server/{loadPage-IDGVDFBB.js → loadPage-AXNAERDS.js} +2 -2
- package/dist/server/{loadPage-IDGVDFBB.js.map → loadPage-AXNAERDS.js.map} +1 -1
- package/dist/server/{loadPage-DP3nrHBi.d.ts → loadPage-BmYJCe_V.d.ts} +2 -2
- package/dist/server/{loadPage-B8mQUUSo.d.mts → loadPage-BucnLHmE.d.mts} +2 -2
- package/dist/server/{loadPage-DNQTTRHL.mjs → loadPage-XR7ORQ2E.mjs} +2 -2
- package/dist/server/loadPage-XR7ORQ2E.mjs.map +1 -0
- package/dist/server/metadata.d.mts +4 -4
- package/dist/server/metadata.d.ts +4 -4
- package/dist/server/metadata.js +1 -1
- package/dist/server/metadata.mjs +1 -1
- package/dist/server/navigation.d.mts +2 -2
- package/dist/server/navigation.d.ts +2 -2
- package/dist/server/navigation.js +1 -1
- package/dist/server/navigation.mjs +1 -1
- package/dist/server/next/revalidate.d.mts +66 -0
- package/dist/server/next/revalidate.d.ts +66 -0
- package/dist/server/next/revalidate.js +60 -0
- package/dist/server/next/revalidate.js.map +1 -0
- package/dist/server/next/revalidate.mjs +60 -0
- package/dist/server/next/revalidate.mjs.map +1 -0
- package/dist/server/next/tags.d.mts +81 -0
- package/dist/server/next/tags.d.ts +81 -0
- package/dist/server/next/tags.js +36 -0
- package/dist/server/next/tags.js.map +1 -0
- package/dist/server/next/tags.mjs +36 -0
- package/dist/server/next/tags.mjs.map +1 -0
- package/dist/server/next.d.mts +164 -6
- package/dist/server/next.d.ts +164 -6
- package/dist/server/next.js +79 -11
- package/dist/server/next.js.map +1 -1
- package/dist/server/next.mjs +76 -8
- package/dist/server/next.mjs.map +1 -1
- package/dist/server/rendering/server.d.mts +4 -4
- package/dist/server/rendering/server.d.ts +4 -4
- package/dist/server/rendering/server.js +1 -1
- package/dist/server/rendering/server.mjs +1 -1
- package/dist/server/rendering.d.mts +7 -7
- package/dist/server/rendering.d.ts +7 -7
- package/dist/server/rendering.js +3 -3
- package/dist/server/rendering.js.map +1 -1
- package/dist/server/rendering.mjs +4 -4
- package/dist/server/routing.d.mts +3 -3
- package/dist/server/routing.d.ts +3 -3
- package/dist/server/routing.js +2 -2
- package/dist/server/routing.mjs +2 -2
- package/dist/server/server.d.mts +5 -5
- package/dist/server/server.d.ts +5 -5
- package/dist/server/server.js +5 -5
- package/dist/server/server.js.map +1 -1
- package/dist/server/server.mjs +5 -5
- package/dist/server/theme-bridge.js +1 -1
- package/dist/server/theme-bridge.mjs +1 -1
- package/dist/server/theme.js +1 -1
- package/dist/server/theme.mjs +1 -1
- package/dist/server/{types-BvcJU7zk.d.ts → types-BRQyLrQU.d.ts} +132 -11
- package/dist/server/{types-Dsu9wsUh.d.mts → types-BSV6Vc-P.d.mts} +2 -2
- package/dist/server/{types-1cLz0vnq.d.mts → types-C-LShyIg.d.mts} +132 -11
- package/dist/server/{types-CVykEqXN.d.ts → types-Dt98DeYa.d.ts} +2 -2
- package/dist/server/webhooks.d.mts +81 -0
- package/dist/server/webhooks.d.ts +81 -0
- package/dist/server/webhooks.js +12 -0
- package/dist/server/webhooks.js.map +1 -0
- package/dist/server/webhooks.mjs +12 -0
- package/dist/server/webhooks.mjs.map +1 -0
- package/package.json +29 -3
- package/dist/client/resolver-BhueZVxZ.d.mts +0 -61
- package/dist/client/resolver-BhueZVxZ.d.ts +0 -61
- package/dist/client/usePage--fGlyrgj.d.mts +0 -6439
- package/dist/client/usePage-BBcFCxOU.d.ts +0 -6297
- package/dist/client/usePage-BC8Q2E3t.d.mts +0 -6431
- package/dist/client/usePage-BTPnCuWC.d.mts +0 -6511
- package/dist/client/usePage-BafOS9UT.d.mts +0 -6512
- package/dist/client/usePage-BcjWPXvh.d.mts +0 -6388
- package/dist/client/usePage-Bnx-kA6x.d.mts +0 -6670
- package/dist/client/usePage-BvKAa3Zw.d.mts +0 -366
- package/dist/client/usePage-BvKAa3Zw.d.ts +0 -366
- package/dist/client/usePage-BydHcMYB.d.mts +0 -6297
- package/dist/client/usePage-C3ZKNwY7.d.mts +0 -6393
- package/dist/client/usePage-CE7X5NcN.d.ts +0 -6439
- package/dist/client/usePage-CHEybPMD.d.ts +0 -6429
- package/dist/client/usePage-CrKw1H6Y.d.ts +0 -6338
- package/dist/client/usePage-CyYpOJud.d.ts +0 -6388
- package/dist/client/usePage-D4fxZbRR.d.mts +0 -6429
- package/dist/client/usePage-DMI8ImsU.d.mts +0 -6338
- package/dist/client/usePage-DoPI6b8V.d.ts +0 -6511
- package/dist/client/usePage-DpRNZUtP.d.ts +0 -6431
- package/dist/client/usePage-QNWArrVO.d.ts +0 -6670
- package/dist/client/usePage-fBgPB6Oq.d.ts +0 -6512
- package/dist/client/usePage-gpVaeWDy.d.ts +0 -6393
- package/dist/server/chunk-7FIJSGHU.mjs.map +0 -1
- package/dist/server/chunk-BJTO5JO5.mjs +0 -11
- package/dist/server/chunk-DGUM43GV.js +0 -11
- package/dist/server/chunk-DGUM43GV.js.map +0 -1
- package/dist/server/chunk-P7UVAMK6.js.map +0 -1
- /package/dist/server/{chunk-BJTO5JO5.mjs.map → chunk-NFEGQTCC.mjs.map} +0 -0
- /package/dist/server/{loadPage-DNQTTRHL.mjs.map → env.mjs.map} +0 -0
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
# Getting Started with RiverbankCMS SDK
|
|
2
|
+
|
|
3
|
+
This site uses RiverbankCMS as a headless CMS. Content is managed through the SDK CLI.
|
|
4
|
+
|
|
5
|
+
## Quick Setup
|
|
6
|
+
|
|
7
|
+
### 1. Verify Environment Configuration
|
|
8
|
+
|
|
9
|
+
Check `.env.local` has these variables:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
# Local development
|
|
13
|
+
RIVERBANK_LOCAL_SITE_ID=your-site-id
|
|
14
|
+
RIVERBANK_LOCAL_DASHBOARD_URL=http://localhost:4000
|
|
15
|
+
RIVERBANK_LOCAL_MGMT_API_KEY=bld_mgmt_sk_...
|
|
16
|
+
|
|
17
|
+
# Production (optional)
|
|
18
|
+
RIVERBANK_REMOTE_SITE_ID=your-site-id
|
|
19
|
+
RIVERBANK_REMOTE_DASHBOARD_URL=https://your-dashboard.riverbankcms.com
|
|
20
|
+
RIVERBANK_REMOTE_MGMT_API_KEY=bld_mgmt_sk_...
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### 2. Pull Content
|
|
24
|
+
|
|
25
|
+
Download current content from the CMS:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
riverbankcms pull
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
This creates a `content/` directory with JSON files:
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
content/
|
|
35
|
+
├── entries/
|
|
36
|
+
│ └── [content-type].json
|
|
37
|
+
├── pages/
|
|
38
|
+
│ └── [page-identifier].json
|
|
39
|
+
└── navigation.json
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### 3. Make Changes
|
|
43
|
+
|
|
44
|
+
Edit the JSON files directly, or use CLI commands:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
# Create or update an entry
|
|
48
|
+
riverbankcms entry upsert blog-post my-new-post --data '{"title": "New Post"}'
|
|
49
|
+
|
|
50
|
+
# Create a page
|
|
51
|
+
riverbankcms page upsert about --title "About Us" --path /about
|
|
52
|
+
|
|
53
|
+
# Add a block to a page
|
|
54
|
+
riverbankcms block upsert about hero-section --kind block.hero --data '{"heading": "About Us"}'
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### 4. Push Changes
|
|
58
|
+
|
|
59
|
+
Preview what would change:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
riverbankcms push --dry-run
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Apply changes to the CMS:
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
riverbankcms push
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Key Documentation
|
|
72
|
+
|
|
73
|
+
| Document | Purpose |
|
|
74
|
+
|----------|---------|
|
|
75
|
+
| `cli-reference.md` | All CLI commands and options |
|
|
76
|
+
| `content-management.md` | How content is structured |
|
|
77
|
+
| `schema.md` | This site's content types and blocks (auto-generated) |
|
|
78
|
+
| `block-types.md` | Available block types (auto-generated) |
|
|
79
|
+
| `workflows/` | Step-by-step guides for common tasks |
|
|
80
|
+
|
|
81
|
+
## Common Tasks
|
|
82
|
+
|
|
83
|
+
| Task | Command |
|
|
84
|
+
|------|---------|
|
|
85
|
+
| Pull all content | `riverbankcms pull` |
|
|
86
|
+
| Push changes | `riverbankcms push` |
|
|
87
|
+
| Preview changes | `riverbankcms push --dry-run` |
|
|
88
|
+
| Create a page | `riverbankcms page upsert <id> --title "..." --path /...` |
|
|
89
|
+
| Add a block | `riverbankcms block upsert <page> <block-id> --kind ... --data '...'` |
|
|
90
|
+
| Publish an entry | `riverbankcms entry publish <type> <id>` |
|
|
91
|
+
| Publish a page | `riverbankcms page publish <id>` |
|
|
92
|
+
| List entries | `riverbankcms entry list <type>` |
|
|
93
|
+
| Get JSON output | Add `--json` to any command |
|
|
94
|
+
|
|
95
|
+
## Configuration Files
|
|
96
|
+
|
|
97
|
+
### riverbank.config.ts
|
|
98
|
+
|
|
99
|
+
Main SDK configuration defining:
|
|
100
|
+
|
|
101
|
+
- Site ID
|
|
102
|
+
- Custom blocks
|
|
103
|
+
- Block field extensions
|
|
104
|
+
- Block field options
|
|
105
|
+
- Content type definitions
|
|
106
|
+
- Sync settings
|
|
107
|
+
|
|
108
|
+
### content.config.ts (if present)
|
|
109
|
+
|
|
110
|
+
Additional content configuration for scaffolding.
|
|
111
|
+
|
|
112
|
+
## Working with Remote/Production
|
|
113
|
+
|
|
114
|
+
Add `--remote` to target production instead of local:
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
# Pull from production
|
|
118
|
+
riverbankcms pull --remote
|
|
119
|
+
|
|
120
|
+
# Push to production (requires --yes for safety)
|
|
121
|
+
riverbankcms push --remote --yes
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
**Safety note:** Remote push requires `--yes` flag to prevent accidental production changes.
|
|
125
|
+
|
|
126
|
+
## Next Steps
|
|
127
|
+
|
|
128
|
+
1. Read `cli-reference.md` for detailed command documentation
|
|
129
|
+
2. Review `schema.md` to understand this site's content model
|
|
130
|
+
3. Check `workflows/` for step-by-step guides
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# Site-Specific Workflows
|
|
2
|
+
|
|
3
|
+
This directory is for workflows specific to this site. The core workflows in `../workflows/` cover generic SDK operations, while this folder is for site-specific procedures.
|
|
4
|
+
|
|
5
|
+
## When to Add Site Workflows
|
|
6
|
+
|
|
7
|
+
Add workflows here when you have:
|
|
8
|
+
|
|
9
|
+
- **Site-specific content patterns** - e.g., "How to add a new product to the catalog"
|
|
10
|
+
- **Custom block configurations** - e.g., "Setting up the featured posts carousel"
|
|
11
|
+
- **Multi-step business processes** - e.g., "Publishing a campaign landing page"
|
|
12
|
+
- **Integration procedures** - e.g., "Syncing content with the marketing site"
|
|
13
|
+
|
|
14
|
+
## Creating a Workflow
|
|
15
|
+
|
|
16
|
+
Create a markdown file following this structure:
|
|
17
|
+
|
|
18
|
+
```markdown
|
|
19
|
+
# Workflow: [Name]
|
|
20
|
+
|
|
21
|
+
## Purpose
|
|
22
|
+
|
|
23
|
+
What this workflow accomplishes and when to use it.
|
|
24
|
+
|
|
25
|
+
## Prerequisites
|
|
26
|
+
|
|
27
|
+
- Required access, tools, or setup
|
|
28
|
+
- Any content that must exist first
|
|
29
|
+
|
|
30
|
+
## Steps
|
|
31
|
+
|
|
32
|
+
1. First step with command
|
|
33
|
+
```bash
|
|
34
|
+
riverbankcms ...
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
2. Second step
|
|
38
|
+
```bash
|
|
39
|
+
riverbankcms ...
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Verification
|
|
43
|
+
|
|
44
|
+
How to confirm the workflow completed successfully.
|
|
45
|
+
|
|
46
|
+
## Rollback (if applicable)
|
|
47
|
+
|
|
48
|
+
How to undo the changes if needed.
|
|
49
|
+
|
|
50
|
+
## Notes
|
|
51
|
+
|
|
52
|
+
Any additional context or edge cases.
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Example Workflows
|
|
56
|
+
|
|
57
|
+
### Site-specific content creation
|
|
58
|
+
|
|
59
|
+
`create-product.md`:
|
|
60
|
+
```markdown
|
|
61
|
+
# Workflow: Create a Product
|
|
62
|
+
|
|
63
|
+
## Purpose
|
|
64
|
+
Add a new product to the catalog with all required fields.
|
|
65
|
+
|
|
66
|
+
## Steps
|
|
67
|
+
1. Create the product entry
|
|
68
|
+
2. Add product images
|
|
69
|
+
3. Link to category
|
|
70
|
+
4. Publish
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### Campaign or seasonal content
|
|
74
|
+
|
|
75
|
+
`launch-campaign.md`:
|
|
76
|
+
```markdown
|
|
77
|
+
# Workflow: Launch Marketing Campaign
|
|
78
|
+
|
|
79
|
+
## Purpose
|
|
80
|
+
Create and publish a campaign landing page with all blocks.
|
|
81
|
+
|
|
82
|
+
## Steps
|
|
83
|
+
1. Create campaign page
|
|
84
|
+
2. Add hero with campaign messaging
|
|
85
|
+
3. Add product grid
|
|
86
|
+
4. Add CTA section
|
|
87
|
+
5. Preview and publish
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Best Practices
|
|
91
|
+
|
|
92
|
+
- Keep workflows focused on one task
|
|
93
|
+
- Include all commands needed (copy-pasteable)
|
|
94
|
+
- Document site-specific field requirements
|
|
95
|
+
- Reference the CLI reference for command details
|
|
96
|
+
- Update workflows when the site schema changes
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
# Workflow: Add a Block
|
|
2
|
+
|
|
3
|
+
This workflow guides you through adding a block to an existing page.
|
|
4
|
+
|
|
5
|
+
## Prerequisites
|
|
6
|
+
|
|
7
|
+
- Page already exists in the CMS
|
|
8
|
+
- Latest content pulled: `riverbankcms pull`
|
|
9
|
+
|
|
10
|
+
## Steps
|
|
11
|
+
|
|
12
|
+
### 1. Check Available Block Types
|
|
13
|
+
|
|
14
|
+
View built-in blocks in `block-types.md`. Common block kinds:
|
|
15
|
+
|
|
16
|
+
| Kind | Description |
|
|
17
|
+
|------|-------------|
|
|
18
|
+
| `block.hero` | Hero sections with heading, subheading, image, CTA |
|
|
19
|
+
| `block.bodyText` | Rich text content |
|
|
20
|
+
| `block.image` | Image with caption |
|
|
21
|
+
| `block.cta` | Call-to-action buttons |
|
|
22
|
+
| `block.embed` | Embedded content (videos, iframes) |
|
|
23
|
+
| `block.gallery` | Image gallery |
|
|
24
|
+
| `block.quote` | Blockquote with attribution |
|
|
25
|
+
|
|
26
|
+
Check `schema.md` for custom blocks specific to this site.
|
|
27
|
+
|
|
28
|
+
### 2. List Existing Blocks
|
|
29
|
+
|
|
30
|
+
See what blocks are already on the page:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
riverbankcms block list <page-identifier>
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
**Example:**
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
riverbankcms block list home
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### 3. Add the Block
|
|
43
|
+
|
|
44
|
+
**Basic usage:**
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
riverbankcms block upsert <page-id> <block-id> --kind <block-kind> --data '<json>'
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
**Examples:**
|
|
51
|
+
|
|
52
|
+
Add a hero block:
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
riverbankcms block upsert home main-hero \
|
|
56
|
+
--kind block.hero \
|
|
57
|
+
--data '{"heading": "Welcome", "subheading": "to our website"}'
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Add a body text block:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
riverbankcms block upsert home intro-content \
|
|
64
|
+
--kind block.bodyText \
|
|
65
|
+
--data '{"content": "<p>Welcome to our site. We offer...</p>"}'
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Add an image block:
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
riverbankcms block upsert home feature-image \
|
|
72
|
+
--kind block.image \
|
|
73
|
+
--data '{"src": "/images/feature.jpg", "alt": "Feature image", "caption": "Our latest product"}'
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Add a CTA block:
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
riverbankcms block upsert home main-cta \
|
|
80
|
+
--kind block.cta \
|
|
81
|
+
--data '{"text": "Get Started", "url": "/signup", "style": "primary"}'
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### 4. Specify Position (Optional)
|
|
85
|
+
|
|
86
|
+
Add the block at a specific position (0-indexed):
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
riverbankcms block upsert home new-section \
|
|
90
|
+
--kind block.bodyText \
|
|
91
|
+
--data '{"content": "<p>...</p>"}' \
|
|
92
|
+
--position 0
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
- `--position 0` places it first
|
|
96
|
+
- `--position 1` places it second
|
|
97
|
+
- Omitting position adds it at the end
|
|
98
|
+
|
|
99
|
+
### 5. Preview the Block
|
|
100
|
+
|
|
101
|
+
Preview how the block will render:
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
riverbankcms preview block.hero \
|
|
105
|
+
--data '{"heading": "Welcome", "subheading": "to our website"}' \
|
|
106
|
+
--open
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### 6. Verify the Block
|
|
110
|
+
|
|
111
|
+
Confirm the block was added:
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
riverbankcms block get home main-hero
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
List all blocks to see the order:
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
riverbankcms block list home
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
## Complex Block Content
|
|
124
|
+
|
|
125
|
+
For blocks with nested or complex content, use a JSON file.
|
|
126
|
+
|
|
127
|
+
### Example: Hero with Background and CTA
|
|
128
|
+
|
|
129
|
+
**hero-content.json:**
|
|
130
|
+
|
|
131
|
+
```json
|
|
132
|
+
{
|
|
133
|
+
"heading": "Welcome to Our Platform",
|
|
134
|
+
"subheading": "Build amazing things with us",
|
|
135
|
+
"backgroundImage": {
|
|
136
|
+
"src": "/images/hero-bg.jpg",
|
|
137
|
+
"alt": "Abstract background"
|
|
138
|
+
},
|
|
139
|
+
"cta": {
|
|
140
|
+
"text": "Get Started",
|
|
141
|
+
"url": "/signup"
|
|
142
|
+
},
|
|
143
|
+
"alignment": "center"
|
|
144
|
+
}
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
```bash
|
|
148
|
+
riverbankcms block upsert home main-hero \
|
|
149
|
+
--kind block.hero \
|
|
150
|
+
--file ./hero-content.json
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
### Example: Gallery Block
|
|
154
|
+
|
|
155
|
+
**gallery-content.json:**
|
|
156
|
+
|
|
157
|
+
```json
|
|
158
|
+
{
|
|
159
|
+
"title": "Our Work",
|
|
160
|
+
"images": [
|
|
161
|
+
{ "src": "/images/project-1.jpg", "alt": "Project 1", "caption": "E-commerce redesign" },
|
|
162
|
+
{ "src": "/images/project-2.jpg", "alt": "Project 2", "caption": "Mobile app" },
|
|
163
|
+
{ "src": "/images/project-3.jpg", "alt": "Project 3", "caption": "Brand identity" }
|
|
164
|
+
],
|
|
165
|
+
"layout": "grid"
|
|
166
|
+
}
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
```bash
|
|
170
|
+
riverbankcms block upsert home portfolio-gallery \
|
|
171
|
+
--kind block.gallery \
|
|
172
|
+
--file ./gallery-content.json
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
## Updating Existing Blocks
|
|
176
|
+
|
|
177
|
+
To update a block, use the same `upsert` command with the same block ID:
|
|
178
|
+
|
|
179
|
+
```bash
|
|
180
|
+
riverbankcms block upsert home main-hero \
|
|
181
|
+
--kind block.hero \
|
|
182
|
+
--data '{"heading": "New Heading", "subheading": "Updated content"}'
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
The block is replaced with the new content.
|
|
186
|
+
|
|
187
|
+
## Reordering Blocks
|
|
188
|
+
|
|
189
|
+
Change the order of blocks on the page:
|
|
190
|
+
|
|
191
|
+
```bash
|
|
192
|
+
riverbankcms block reorder home main-hero intro-content feature-image main-cta
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
Blocks appear in the order listed.
|
|
196
|
+
|
|
197
|
+
## Deleting Blocks
|
|
198
|
+
|
|
199
|
+
Remove a block:
|
|
200
|
+
|
|
201
|
+
```bash
|
|
202
|
+
riverbankcms delete block home old-section --yes
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
## Troubleshooting
|
|
206
|
+
|
|
207
|
+
### "Invalid block kind"
|
|
208
|
+
|
|
209
|
+
- Check the kind matches exactly (e.g., `block.hero` not `hero`)
|
|
210
|
+
- See `block-types.md` for valid system blocks
|
|
211
|
+
- See `schema.md` for custom blocks (e.g., `custom.my-block`)
|
|
212
|
+
|
|
213
|
+
### Block not rendering correctly
|
|
214
|
+
|
|
215
|
+
- Verify the data structure matches what the block expects
|
|
216
|
+
- Preview the block: `riverbankcms preview <kind> --data '...' --open`
|
|
217
|
+
- Check for required fields in `block-types.md`
|
|
218
|
+
|
|
219
|
+
### JSON parsing error
|
|
220
|
+
|
|
221
|
+
- Ensure JSON is properly quoted in the shell
|
|
222
|
+
- Use single quotes around the JSON string
|
|
223
|
+
- For complex content, use `--file` instead of `--data`
|
|
224
|
+
|
|
225
|
+
### Block at wrong position
|
|
226
|
+
|
|
227
|
+
- Use `riverbankcms block reorder` to fix the order
|
|
228
|
+
- Or delete and re-add with `--position`
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
# Workflow: Create a Page
|
|
2
|
+
|
|
3
|
+
This workflow guides you through creating a new page in the CMS.
|
|
4
|
+
|
|
5
|
+
## Prerequisites
|
|
6
|
+
|
|
7
|
+
- SDK CLI installed (`@riverbankcms/sdk`)
|
|
8
|
+
- Environment variables configured in `.env.local`
|
|
9
|
+
- Latest content pulled: `riverbankcms pull`
|
|
10
|
+
|
|
11
|
+
## Steps
|
|
12
|
+
|
|
13
|
+
### 1. Create the Page
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
riverbankcms page upsert <identifier> \
|
|
17
|
+
--title "Page Title" \
|
|
18
|
+
--path /url-path \
|
|
19
|
+
--seo-title "SEO Title" \
|
|
20
|
+
--seo-description "Meta description for search engines"
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
**Example:**
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
riverbankcms page upsert contact \
|
|
27
|
+
--title "Contact Us" \
|
|
28
|
+
--path /contact \
|
|
29
|
+
--seo-title "Contact Us | Company Name" \
|
|
30
|
+
--seo-description "Get in touch with our team. We'd love to hear from you."
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### 2. Add Blocks to the Page
|
|
34
|
+
|
|
35
|
+
Add a hero block:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
riverbankcms block upsert contact hero-section \
|
|
39
|
+
--kind block.hero \
|
|
40
|
+
--data '{"heading": "Contact Us", "subheading": "We would love to hear from you"}'
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Add a body text block:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
riverbankcms block upsert contact intro-text \
|
|
47
|
+
--kind block.bodyText \
|
|
48
|
+
--data '{"content": "<p>Reach out using the form below or email us directly.</p>"}'
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Add more blocks as needed. See `block-types.md` for available block types.
|
|
52
|
+
|
|
53
|
+
### 3. Preview Blocks (Optional)
|
|
54
|
+
|
|
55
|
+
Preview individual blocks before publishing:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
riverbankcms preview block.hero \
|
|
59
|
+
--data '{"heading": "Contact Us", "subheading": "We would love to hear from you"}' \
|
|
60
|
+
--open
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### 4. Verify the Page
|
|
64
|
+
|
|
65
|
+
Check the page was created:
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
riverbankcms page get contact
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
List blocks on the page:
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
riverbankcms block list contact
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### 5. Publish the Page
|
|
78
|
+
|
|
79
|
+
When ready to make the page live:
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
riverbankcms page publish contact
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Additional Operations
|
|
86
|
+
|
|
87
|
+
### Reordering Blocks
|
|
88
|
+
|
|
89
|
+
Change the order of blocks on the page:
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
riverbankcms block reorder contact hero-section intro-text form-section
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Blocks will appear in the order specified.
|
|
96
|
+
|
|
97
|
+
### Editing Block Content
|
|
98
|
+
|
|
99
|
+
Update an existing block by upserting with new data:
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
riverbankcms block upsert contact hero-section \
|
|
103
|
+
--kind block.hero \
|
|
104
|
+
--data '{"heading": "New Heading", "subheading": "Updated subheading"}'
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### Deleting Blocks
|
|
108
|
+
|
|
109
|
+
Remove a block from the page:
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
riverbankcms delete block contact hero-section --yes
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### Using JSON Files for Complex Content
|
|
116
|
+
|
|
117
|
+
For blocks with complex nested content, use a JSON file:
|
|
118
|
+
|
|
119
|
+
**hero-content.json:**
|
|
120
|
+
|
|
121
|
+
```json
|
|
122
|
+
{
|
|
123
|
+
"heading": "Contact Our Team",
|
|
124
|
+
"subheading": "We're here to help",
|
|
125
|
+
"backgroundImage": {
|
|
126
|
+
"src": "/images/contact-bg.jpg",
|
|
127
|
+
"alt": "Office background"
|
|
128
|
+
},
|
|
129
|
+
"cta": {
|
|
130
|
+
"text": "Send Message",
|
|
131
|
+
"url": "#contact-form"
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
riverbankcms block upsert contact hero-section \
|
|
138
|
+
--kind block.hero \
|
|
139
|
+
--file ./hero-content.json
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
## Complete Example
|
|
143
|
+
|
|
144
|
+
Create a full about page with multiple blocks:
|
|
145
|
+
|
|
146
|
+
```bash
|
|
147
|
+
# 1. Create the page
|
|
148
|
+
riverbankcms page upsert about \
|
|
149
|
+
--title "About Us" \
|
|
150
|
+
--path /about \
|
|
151
|
+
--seo-title "About Us | Company Name" \
|
|
152
|
+
--seo-description "Learn about our company, mission, and team."
|
|
153
|
+
|
|
154
|
+
# 2. Add hero block
|
|
155
|
+
riverbankcms block upsert about hero \
|
|
156
|
+
--kind block.hero \
|
|
157
|
+
--data '{"heading": "About Us", "subheading": "Our story and mission"}'
|
|
158
|
+
|
|
159
|
+
# 3. Add introduction text
|
|
160
|
+
riverbankcms block upsert about intro \
|
|
161
|
+
--kind block.bodyText \
|
|
162
|
+
--data '{"content": "<p>Founded in 2020, we have been...</p>"}'
|
|
163
|
+
|
|
164
|
+
# 4. Add team section (if using a team block)
|
|
165
|
+
riverbankcms block upsert about team \
|
|
166
|
+
--kind block.bodyText \
|
|
167
|
+
--data '{"content": "<h2>Our Team</h2><p>Meet the people behind the company.</p>"}'
|
|
168
|
+
|
|
169
|
+
# 5. Verify
|
|
170
|
+
riverbankcms page get about
|
|
171
|
+
riverbankcms block list about
|
|
172
|
+
|
|
173
|
+
# 6. Publish when ready
|
|
174
|
+
riverbankcms page publish about
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
## Troubleshooting
|
|
178
|
+
|
|
179
|
+
### Page already exists
|
|
180
|
+
|
|
181
|
+
If the page identifier already exists, `upsert` will update it. This is intentional - use unique identifiers for new pages.
|
|
182
|
+
|
|
183
|
+
### Block not appearing
|
|
184
|
+
|
|
185
|
+
- Verify the block was created: `riverbankcms block get <page> <block-id>`
|
|
186
|
+
- Check block kind is valid: see `block-types.md`
|
|
187
|
+
- Ensure JSON data is properly formatted
|
|
188
|
+
|
|
189
|
+
### Page not showing on site
|
|
190
|
+
|
|
191
|
+
- Check if page is published: `riverbankcms page get <identifier>`
|
|
192
|
+
- Look for `status: "published"` in the output
|
|
193
|
+
- Publish if needed: `riverbankcms page publish <identifier>`
|