@sleekcms/sync 1.5.0 → 1.6.0
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 +1 -1
- package/dist/AGENT.md +3 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -281,7 +281,7 @@ Models describe the shape of your content. They're JSON-like files with unquoted
|
|
|
281
281
|
| `json` | Object or array |
|
|
282
282
|
| `block(key)` | Embedded block object |
|
|
283
283
|
| `stack` | Array of heterogeneous block objects; each item carries `_block: "<block_key>"` to name its block |
|
|
284
|
-
| `entry(key)` |
|
|
284
|
+
| `entry(key)` | Reference token `"<index>\|<text>"` — `index` is the entry's 0-based position in `content/entries/<key>+.json` (what binds); the optional `<text>` is the entry's opening content copied verbatim (a substring check, not a summary you write). Resolves to the entry object in templates |
|
|
285
285
|
|
|
286
286
|
---
|
|
287
287
|
|
package/dist/AGENT.md
CHANGED
|
@@ -279,7 +279,7 @@ Model fields declare both the editor type and the shape expected in content JSON
|
|
|
279
279
|
| `block(key)` | Object matching that block's model; stored inline in the parent page/entry content and rendered with `blocks/<key>.ejs` |
|
|
280
280
|
| `[block(key)]` | Array of block objects; each item matches the block model and renders with `blocks/<key>.ejs` |
|
|
281
281
|
| `stack` | Array of heterogeneous block-shaped objects. Each item is `{ "_block": "<block_key>", ...fields_of_that_block }`. `_block` is the target block's key as a plain string; the remaining keys must match that block's model. Different items in the same stack may use different blocks. Stored inline; each item renders through its own `blocks/<key>.ejs`. The CMS resolves block keys to ids server-side — never write numeric ids. |
|
|
282
|
-
| `entry(key)` / `[entry(key)]` |
|
|
282
|
+
| `entry(key)` / `[entry(key)]` | Reference token `"<index>\|<text>"` (or an array of them) in content JSON; entry object / array of entry objects in templates. `index` is the 0-based position of the target entry in its `content/entries/<key>+.json` list — that is what binds. `\|<text>` is optional: the **opening characters of that entry's content, copied verbatim** (matched as a substring — not a description you compose), used only to relocate the entry if the list shifted. You may write just the index (`"2"` or `2`). |
|
|
283
283
|
| Group `{ ... }` | Nested object |
|
|
284
284
|
| Collection `[{ ... }]` | Array of nested objects |
|
|
285
285
|
|
|
@@ -324,11 +324,11 @@ The content file at `content/pages/about.json`:
|
|
|
324
324
|
"cta_label": "Contact us",
|
|
325
325
|
"cta_link": "/contact"
|
|
326
326
|
},
|
|
327
|
-
"tags": ["
|
|
327
|
+
"tags": ["0|Engineering", "2|Design"]
|
|
328
328
|
}
|
|
329
329
|
```
|
|
330
330
|
|
|
331
|
-
Here `hero` is embedded block data stored directly in the page content file. `image` and `hero.background` use the shortcut form — on save, the sync engine replaces each shortcut with a real image object (`{ "url": "...", "alt": "..." }`). Write the object form directly when you have a specific asset URL.
|
|
331
|
+
Here `hero` is embedded block data stored directly in the page content file. `image` and `hero.background` use the shortcut form — on save, the sync engine replaces each shortcut with a real image object (`{ "url": "...", "alt": "..." }`). Write the object form directly when you have a specific asset URL. `tags` references entries by position — `"0|Engineering"` points at the first entry in `content/entries/tags+.json`, where `Engineering` is just the start of that entry's content copied verbatim (a substring check, not a description you write). The index is what binds on save; the text only helps relocate the entry if the list shifted, and a bare index (`"0"`) is also accepted.
|
|
332
332
|
|
|
333
333
|
### Markdown content files
|
|
334
334
|
|