@se-studio/skills 1.0.4 → 1.0.5
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/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -75,6 +75,16 @@ Page: /pricing [4xKj2abc | published] · om1
|
|
|
75
75
|
|
|
76
76
|
Use `snapshot -c` for compact output (types only, no labels).
|
|
77
77
|
|
|
78
|
+
**Ref cheat sheet:**
|
|
79
|
+
| Ref | Resolves to |
|
|
80
|
+
|-----|-------------|
|
|
81
|
+
| `@root` | Root entry of the current session (works in any session type) |
|
|
82
|
+
| `@p0` | Root entry — alias for `@root` in **page** and **article** sessions only |
|
|
83
|
+
| `@c0` | Same as `@root` (first entry in depth-first traversal order) |
|
|
84
|
+
| `@c1`, `@c2`, … | Child entries in depth-first traversal order |
|
|
85
|
+
|
|
86
|
+
In **navigation sessions**, use `@root` or `@c0` for the nav root — `@p0` is not valid.
|
|
87
|
+
|
|
78
88
|
### Step 3: Read entry fields
|
|
79
89
|
|
|
80
90
|
```bash
|
|
@@ -108,10 +118,14 @@ Each token is `@ref:fieldName=value`. All values are scalar (string, boolean, nu
|
|
|
108
118
|
cms-edit set @c0 template 3I0HxGKbUd173wIpFCsbVr --link
|
|
109
119
|
```
|
|
110
120
|
|
|
111
|
-
**
|
|
121
|
+
**Entry link arrays** (`--links` works on any field that is an array of entry links — not just the standard page content fields):
|
|
112
122
|
```bash
|
|
123
|
+
# Standard page content arrays
|
|
113
124
|
cms-edit set @p0 content @c1,@c2,@c3 --links
|
|
114
125
|
cms-edit set @p0 bottomContent @c4 --links --append
|
|
126
|
+
|
|
127
|
+
# Navigation items array (use @root or @c0 in a nav session)
|
|
128
|
+
cms-edit set @root items <id1>,<id2>,<id3> --links
|
|
115
129
|
```
|
|
116
130
|
|
|
117
131
|
**Rich text fields** (body, additionalCopy):
|
|
@@ -344,9 +358,16 @@ cms-edit asset set @c0 visual 5xKj2abcDef
|
|
|
344
358
|
# Open a navigation entry
|
|
345
359
|
cms-edit nav open main-navigation
|
|
346
360
|
|
|
347
|
-
# Add
|
|
361
|
+
# Add a new item
|
|
348
362
|
cms-edit nav add --label "Pricing" --slug /pricing
|
|
349
363
|
cms-edit nav add --label "Docs" --href https://docs.example.com --after @c1
|
|
364
|
+
|
|
365
|
+
# Link an existing NavigationItem (share items across navigations)
|
|
366
|
+
cms-edit nav add --existing-id <navigationItem-entry-id>
|
|
367
|
+
|
|
368
|
+
# Clone a navigation (duplicates all items)
|
|
369
|
+
cms-edit nav clone <source-nav-id>
|
|
370
|
+
cms-edit nav clone <source-nav-id> --label "LP Nav" --slug lp-nav
|
|
350
371
|
```
|
|
351
372
|
|
|
352
373
|
## Create New Entries
|
|
@@ -436,7 +457,7 @@ cms-edit save
|
|
|
436
457
|
### Update an existing article
|
|
437
458
|
```bash
|
|
438
459
|
cms-edit open /blog/old-title --id # or by slug
|
|
439
|
-
cms-edit set @p0 title "New Article Title"
|
|
460
|
+
cms-edit set @p0 title "New Article Title" # @p0 works in article sessions too
|
|
440
461
|
cms-edit set @p0 slug new-article-slug
|
|
441
462
|
cms-edit set @p0 description "Updated description"
|
|
442
463
|
cms-edit save
|
|
@@ -11,12 +11,73 @@ Use this skill when creating or editing **navigation** entries and their items i
|
|
|
11
11
|
|
|
12
12
|
1. **Create** a navigation: `cms-edit create navigation --label 'Main menu'`
|
|
13
13
|
2. **Open** the nav: `cms-edit nav open <slug-or-id>` (or after create, use the printed open command)
|
|
14
|
-
3. **Add
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
3. **Add items** (new or existing):
|
|
15
|
+
```bash
|
|
16
|
+
# Create a new nav item with a page link
|
|
17
|
+
cms-edit nav add --label "Pricing" --slug /pricing
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
# Create a new nav item with an external URL
|
|
20
|
+
cms-edit nav add --label "Docs" --href https://docs.example.com --after @c1
|
|
21
|
+
|
|
22
|
+
# Link an EXISTING NavigationItem entry (e.g. to share items across navigations)
|
|
23
|
+
cms-edit nav add --existing-id <navigationItem-entry-id>
|
|
24
|
+
cms-edit nav add --existing-id <id> --after @c1
|
|
25
|
+
```
|
|
26
|
+
4. **Set** nav item fields (use snapshot refs): `cms-edit set @c1 title "New label"`, `cms-edit set @c1 internal <page-entry-id> --link`, `cms-edit set @c1 link "https://..."`.
|
|
27
|
+
5. **Set the items array directly** (e.g. to replace all items at once):
|
|
28
|
+
```bash
|
|
29
|
+
cms-edit set @root items <id1>,<id2>,<id3> --links
|
|
30
|
+
```
|
|
31
|
+
6. **Remove** an item: `cms-edit remove @cN`
|
|
32
|
+
7. **Save**: `cms-edit save`
|
|
33
|
+
|
|
34
|
+
## Cloning a navigation
|
|
35
|
+
|
|
36
|
+
To duplicate a navigation and all its items (e.g. for a landing page variant):
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
cms-edit nav clone <source-nav-id>
|
|
40
|
+
# Optional: provide a custom label/slug for the clone
|
|
41
|
+
cms-edit nav clone <source-nav-id> --label "LP Navigation" --slug lp-nav
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
This creates new copies of every NavigationItem and links them into the new navigation. Prints the new navigation ID and an `open` command.
|
|
45
|
+
|
|
46
|
+
## Session refs
|
|
47
|
+
|
|
48
|
+
In a navigation session, the root navigation entry is **`@c0`** (or the universal alias **`@root`**). The `@p0` alias only works in page/article sessions.
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
cms-edit nav open main-navigation
|
|
52
|
+
cms-edit snapshot # root is @c0; items are @c1, @c2, …
|
|
53
|
+
cms-edit read @root # same as @c0
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Visual fields (media wrapper)
|
|
57
|
+
|
|
58
|
+
Visual fields expect a **`media` Entry link**, not a direct Asset ID. `cms-edit asset set` now auto-creates the wrapper:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
cms-edit asset set @c0 visual <asset-id>
|
|
62
|
+
# → auto-creates a media entry wrapping the asset, then sets visual to that entry
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
If you need to create the media wrapper manually:
|
|
66
|
+
```bash
|
|
67
|
+
cms-edit create media <asset-id> # prints the media entry ID
|
|
68
|
+
cms-edit set @c0 visual <media-entry-id> --link
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Linking navigation from a template
|
|
72
|
+
|
|
73
|
+
Navigation entries are often linked from templates as **menu** or **footer**:
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
cms-edit open <template-id> --id
|
|
77
|
+
cms-edit set @root menu <nav-entry-id> --link
|
|
78
|
+
cms-edit set @root footer <footer-nav-id> --link
|
|
79
|
+
cms-edit save
|
|
80
|
+
```
|
|
20
81
|
|
|
21
82
|
## Related skills
|
|
22
83
|
|