@sleekcms/sync 2.8.0 → 2.9.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.
Files changed (3) hide show
  1. package/README.md +19 -3
  2. package/dist/AGENT.md +16 -1
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -201,9 +201,11 @@ No manual deploy. No waiting. SleekCMS rebuilds on every sync and the preview re
201
201
  │ ├── entries/<key>[].json # Collection entry content (array)
202
202
  │ └── images.json # Reusable site-level images (handle → shortcut)
203
203
  │
204
- └── public/
205
- ├── css/<name>.css # Stylesheets
206
- └── js/<name>.js # Scripts
204
+ ├── public/
205
+ │ ├── css/<name>.css # Stylesheets
206
+ │ └── js/<name>.js # Scripts
207
+ │
208
+ └── setup.json # Site setup: default page title, Tailwind on/off, sitemap on/off
207
209
  ```
208
210
 
209
211
  ### File naming
@@ -410,6 +412,20 @@ Any form with `data-sleekcms="<name>"` captures and stores submissions in the CM
410
412
 
411
413
  Content lives in `src/content/` as plain JSON. Edit any content file and save — it syncs like any other file.
412
414
 
415
+ ## Site setup (`src/setup.json`)
416
+
417
+ Site-wide decisions made once — the default page title, whether Tailwind is compiled, and whether a sitemap is published — live in `src/setup.json`, mirrored from **Settings → Website** in the CMS. The file is JSON with a comment above each key explaining it:
418
+
419
+ ```json5
420
+ {
421
+ title: "Acme Dental", // default <title> for pages without their own; null = the site name
422
+ tw_enabled: true, // compile src/public/css/tailwind.css and inject it into every page
423
+ sitemap_enabled: false, // publish sitemap.xml + robots.txt on every build
424
+ }
425
+ ```
426
+
427
+ Edit the values and save — it syncs like any other file. Keys you leave out keep their current value. Which pages are excluded from the sitemap is managed in the CMS UI, not in this file.
428
+
413
429
  ## Images
414
430
 
415
431
  Images are part of content, not a separate asset pipeline. Drop a shortcut string into any `image` field and the sync engine resolves it to a full `{ url, alt }` object on save:
package/dist/AGENT.md CHANGED
@@ -86,6 +86,8 @@ content/entries/<key>.json Content for a single entry (object)
86
86
  content/entries/<key>+.json Collection entry — ONE file holding a JSON array of all items
87
87
  content/images.json Site-level reusable images: handle → shortcut (§7)
88
88
  content/videos.json Site-level videos: handle → pexels:/pixabay: ref (user uploads show as embed_url) (§7)
89
+
90
+ setup.json Site setup (JSON, comments allowed): default page title, Tailwind on/off, sitemap on/off — edit values in place, never delete
89
91
  ```
90
92
 
91
93
  **Collection storage differs by kind — do not confuse them:**
@@ -97,6 +99,16 @@ content/videos.json Site-level videos: handle → pexels:/pixabay: r
97
99
  - **Public URL** (what `link()`/`script()` and HTML `href`/`src` take): `/css/styles.css`, `/js/app.js`.
98
100
  - **Page route** (what visitors see): `/about`, `/blog/<slug>`. Computed from the page key.
99
101
 
102
+ **Site setup (`setup.json`)** — the set-once site decisions, mirrored from Settings > Website in the CMS. Each key is explained by the comment above it in the file:
103
+
104
+ | Key | Value | Effect |
105
+ |---|---|---|
106
+ | `title` | string or `null` | Default `<title>` for pages that don't set their own (via `title()` or the SEO block). `null` = the site name. |
107
+ | `tw_enabled` | boolean | `true` compiles `css/tailwind.css` and injects it into every page — required for any site styled with Tailwind utilities. |
108
+ | `sitemap_enabled` | boolean | `true` publishes `sitemap.xml` + `robots.txt` on every build. Turn it on for public sites and SEO work. |
109
+
110
+ Edit values in place and keep the keys. Keys you omit keep their stored values; unknown keys are ignored. Which pages are excluded from the sitemap is a CMS UI setting, not a key in this file. Never delete the file.
111
+
100
112
  ## 5. Common Tasks
101
113
 
102
114
  ### Create a single page (e.g. `/about`)
@@ -426,9 +438,11 @@ Make every site strongly SEO- and sharing-friendly. The standard pattern is a re
426
438
 
427
439
  Add `seo: block(seo)` to page models and render it **once from the layout head**: `<% if (item.seo) { %><%- render(item.seo) %><% } %>` in `layouts/common.ejs` (as in the layout example above) — not per page view.
428
440
 
441
+ Two site-level SEO switches live in `setup.json` (§4), not in views: `sitemap_enabled: true` publishes `sitemap.xml` + `robots.txt` on every build, and `title` is the site's default `<title>` for pages whose SEO block leaves the title empty (`null` = the site name). Sitemap page exclusions are chosen in the CMS UI — there is no file setting for them.
442
+
429
443
  ## 10. Forms
430
444
 
431
- Any `<form>` with `data-sleekcms="<name>"` works automatically — submissions are captured and shown in the CMS dashboard. No backend, no action URL, no JS.
445
+ Any `<form>` with `data-sleekcms="<hardcoded name>"` works automatically — submissions are captured and shown in the CMS dashboard. No backend, no action URL, no JS.
432
446
 
433
447
  ```html
434
448
  <form data-sleekcms="contact">
@@ -545,3 +559,4 @@ Snipcart powers stores. Use it when the business **sells products** and the user
545
559
  12. Image shortcuts (`"iconify:..."`, `"pexels:..."`, etc.) resolve **only** in `image`/`icon`-typed fields. CMS-editable icons are declared `icon: icon`, never `icon: text` — render with `svg(item.icon)`; fixed UI icons need no field: `svg('iconify:...')` directly in the view.
546
560
  13. Use entries (`entry(key+)`) for shared content (authors, testimonials, nav, footer) — not blocks. Block models cannot contain `block(...)` or `stack` fields; use blocks only when a group of fields also benefits from a reusable view.
547
561
  14. Always create an RSS feed for blogs (`rss.xml` key) and make every site strongly SEO- and sharing-friendly (reusable `seo` block rendered once from the layout head).
562
+ 15. Site-wide setup — default page title, Tailwind on/off, sitemap on/off — lives in `setup.json` (§4). Change values there rather than hard-coding a site title into the layout, and never delete the file. Sitemap page exclusions are UI-only.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sleekcms/sync",
3
- "version": "2.8.0",
3
+ "version": "2.9.0",
4
4
  "description": "Edit SleekCMS sites locally — models, content, templates, images — with live two-way sync and AI agent support.",
5
5
  "keywords": [
6
6
  "sleekcms",