@sveltia/cms 0.91.3 → 0.91.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/README.md +81 -3
- package/dist/sveltia-cms.js +295 -295
- package/dist/sveltia-cms.js.map +1 -1
- package/dist/sveltia-cms.mjs +303 -303
- package/dist/sveltia-cms.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -83,6 +83,7 @@ The free, open source alternative/successor to Netlify/Decap CMS is now in publi
|
|
|
83
83
|
- [Changing the input type of a DateTime field](#changing-the-input-type-of-a-datetime-field)
|
|
84
84
|
- [Rendering soft line breaks as hard line breaks in Markdown](#rendering-soft-line-breaks-as-hard-line-breaks-in-markdown)
|
|
85
85
|
- [Controlling data output](#controlling-data-output)
|
|
86
|
+
- [Understanding exceptions in data output](#understanding-exceptions-in-data-output)
|
|
86
87
|
- [Disabling automatic deployments](#disabling-automatic-deployments)
|
|
87
88
|
- [Setting up Content Security Policy](#setting-up-content-security-policy)
|
|
88
89
|
- [Showing the CMS version](#showing-the-cms-version)
|
|
@@ -620,7 +621,7 @@ These Netlify/Decap CMS features are not yet implemented in Sveltia CMS. We are
|
|
|
620
621
|
|
|
621
622
|
Due to the complexity, we have decided to defer the following features to the 2.0 release due early 2026. Netlify/Decap CMS has a number of open issues with these collaboration and beta features — we want to implement them the right way.
|
|
622
623
|
|
|
623
|
-
- [Editorial workflow](https://decapcms.org/docs/editorial-workflows/)
|
|
624
|
+
- [Editorial workflow](https://decapcms.org/docs/editorial-workflows/)
|
|
624
625
|
- [Open authoring](https://decapcms.org/docs/open-authoring/)
|
|
625
626
|
- [Nested collections](https://decapcms.org/docs/collection-nested/) (beta)
|
|
626
627
|
- Field-specific media folders (beta) for the [File](https://decapcms.org/docs/widgets/#file) and [Image](https://decapcms.org/docs/widgets/#image) widgets
|
|
@@ -1351,6 +1352,83 @@ output:
|
|
|
1351
1352
|
indent_size: 2
|
|
1352
1353
|
```
|
|
1353
1354
|
|
|
1355
|
+
### Understanding exceptions in data output
|
|
1356
|
+
|
|
1357
|
+
Content is generally saved as key-value pairs in a file, where the key is the field name and the value is the field value. However, there are some exceptions you should be aware of.
|
|
1358
|
+
|
|
1359
|
+
If the format is front matter, the `body` field is saved outside of the front matter block, as briefly explained in the [Decap CMS documentation](https://decapcms.org/docs/configuration-options/):
|
|
1360
|
+
|
|
1361
|
+
```yaml
|
|
1362
|
+
---
|
|
1363
|
+
title: My Post
|
|
1364
|
+
date: 2025-01-01
|
|
1365
|
+
---
|
|
1366
|
+
This is the body of my post.
|
|
1367
|
+
```
|
|
1368
|
+
|
|
1369
|
+
instead of
|
|
1370
|
+
|
|
1371
|
+
```yaml
|
|
1372
|
+
---
|
|
1373
|
+
title: My Post
|
|
1374
|
+
date: 2025-01-01
|
|
1375
|
+
body: This is the body of my post.
|
|
1376
|
+
---
|
|
1377
|
+
```
|
|
1378
|
+
|
|
1379
|
+
However, this doesn’t apply when i18n is enabled with the `single_file` structure. In this case, the `body` field is saved part of key-value pairs under each locale in the front matter block:
|
|
1380
|
+
|
|
1381
|
+
```yaml
|
|
1382
|
+
---
|
|
1383
|
+
en:
|
|
1384
|
+
title: My Post
|
|
1385
|
+
date: 2025-01-01
|
|
1386
|
+
body: This is the body of my post.
|
|
1387
|
+
fr:
|
|
1388
|
+
title: Mon article
|
|
1389
|
+
date: 2025-01-01
|
|
1390
|
+
body: C’est le corps de mon article.
|
|
1391
|
+
---
|
|
1392
|
+
```
|
|
1393
|
+
|
|
1394
|
+
There are two exceptional cases for the List widget:
|
|
1395
|
+
|
|
1396
|
+
1. When the `field` (singular) option is used, the `name` property is omitted from the output. It will be saved as a simple list of values:
|
|
1397
|
+
```yaml
|
|
1398
|
+
images:
|
|
1399
|
+
- https://example.com/image1.jpg
|
|
1400
|
+
- https://example.com/image2.jpg
|
|
1401
|
+
```
|
|
1402
|
+
instead of an array of objects:
|
|
1403
|
+
```yaml
|
|
1404
|
+
images:
|
|
1405
|
+
- name: https://example.com/image1.jpg
|
|
1406
|
+
- name: https://example.com/image2.jpg
|
|
1407
|
+
```
|
|
1408
|
+
This is not mentioned in the [Decap CMS documentation](https://decapcms.org/docs/widgets/#list), but it’s a known behaviour. If you expect the latter, you can use the `fields` (plural) option to define a single field:
|
|
1409
|
+
```yaml
|
|
1410
|
+
- name: images
|
|
1411
|
+
label: Images
|
|
1412
|
+
widget: list
|
|
1413
|
+
fields:
|
|
1414
|
+
- { name: image, label: Image, widget: image }
|
|
1415
|
+
```
|
|
1416
|
+
1. When the [`root` option](#editing-data-files-with-a-top-level-list) is set to `true`, the List field is saved as a top-level list without a field name:
|
|
1417
|
+
```yaml
|
|
1418
|
+
- name: John Doe
|
|
1419
|
+
id: 12345
|
|
1420
|
+
- name: Jane Smith
|
|
1421
|
+
id: 67890
|
|
1422
|
+
```
|
|
1423
|
+
instead of
|
|
1424
|
+
```yaml
|
|
1425
|
+
members:
|
|
1426
|
+
- name: John Doe
|
|
1427
|
+
id: 12345
|
|
1428
|
+
- name: Jane Smith
|
|
1429
|
+
id: 67890
|
|
1430
|
+
```
|
|
1431
|
+
|
|
1354
1432
|
### Disabling automatic deployments
|
|
1355
1433
|
|
|
1356
1434
|
You may already have a CI/CD tool set up on your Git repository to automatically deploy changes to production. Occasionally, you make a lot of changes to your content to quickly reach the CI/CD provider’s (free) build limits, or you just don’t want to see builds triggered for every single small change.
|
|
@@ -1744,11 +1822,11 @@ This software is provided “as is” without any express or implied warranty. W
|
|
|
1744
1822
|
|
|
1745
1823
|
[^70]: Netlify/Decap CMS [#6482](https://github.com/decaporg/decap-cms/issues/6482)
|
|
1746
1824
|
|
|
1747
|
-
[^71]: Netlify/Decap CMS [#6999](https://github.com/decaporg/decap-cms/issues/6999), [#7000](https://github.com/decaporg/decap-cms/issues/7000), [#7001](https://github.com/decaporg/decap-cms/issues/7001), [#7152](https://github.com/decaporg/decap-cms/issues/7152), [#7220](https://github.com/decaporg/decap-cms/issues/7220), [#7283](https://github.com/decaporg/decap-cms/issues/7283), [#7316](https://github.com/decaporg/decap-cms/issues/7316), [#7429](https://github.com/decaporg/decap-cms/issues/7429), [#7465](https://github.com/decaporg/decap-cms/issues/7465), [#7500](https://github.com/decaporg/decap-cms/issues/7500)
|
|
1825
|
+
[^71]: Netlify/Decap CMS [#6999](https://github.com/decaporg/decap-cms/issues/6999), [#7000](https://github.com/decaporg/decap-cms/issues/7000), [#7001](https://github.com/decaporg/decap-cms/issues/7001), [#7152](https://github.com/decaporg/decap-cms/issues/7152), [#7220](https://github.com/decaporg/decap-cms/issues/7220), [#7283](https://github.com/decaporg/decap-cms/issues/7283), [#7316](https://github.com/decaporg/decap-cms/issues/7316), [#7429](https://github.com/decaporg/decap-cms/issues/7429), [#7465](https://github.com/decaporg/decap-cms/issues/7465), [#7500](https://github.com/decaporg/decap-cms/issues/7500), [#7552](https://github.com/decaporg/decap-cms/issues/7552)
|
|
1748
1826
|
|
|
1749
1827
|
[^72]: Netlify/Decap CMS [#7047](https://github.com/decaporg/decap-cms/issues/7047)
|
|
1750
1828
|
|
|
1751
|
-
[^73]: Netlify/Decap CMS [#6993](https://github.com/decaporg/decap-cms/issues/6993), [#7123](https://github.com/decaporg/decap-cms/issues/7123), [#7127](https://github.com/decaporg/decap-cms/issues/7127), [#7128](https://github.com/decaporg/decap-cms/issues/7128), [#7237](https://github.com/decaporg/decap-cms/issues/7237), [#7251](https://github.com/decaporg/decap-cms/issues/7251), [#7361](https://github.com/decaporg/decap-cms/issues/7361), [#7391](https://github.com/decaporg/decap-cms/issues/7391), [#7393](https://github.com/decaporg/decap-cms/issues/7393), [#7470](https://github.com/decaporg/decap-cms/issues/7470), [#7475](https://github.com/decaporg/decap-cms/issues/7475), [#7480](https://github.com/decaporg/decap-cms/issues/7480), [#7503](https://github.com/decaporg/decap-cms/issues/7503), [#7504](https://github.com/decaporg/decap-cms/issues/7504), [#7524](https://github.com/decaporg/decap-cms/issues/7524), [#7531](https://github.com/decaporg/decap-cms/issues/7531), [#7535](https://github.com/decaporg/decap-cms/issues/7535)
|
|
1829
|
+
[^73]: Netlify/Decap CMS [#6993](https://github.com/decaporg/decap-cms/issues/6993), [#7123](https://github.com/decaporg/decap-cms/issues/7123), [#7127](https://github.com/decaporg/decap-cms/issues/7127), [#7128](https://github.com/decaporg/decap-cms/issues/7128), [#7237](https://github.com/decaporg/decap-cms/issues/7237), [#7251](https://github.com/decaporg/decap-cms/issues/7251), [#7361](https://github.com/decaporg/decap-cms/issues/7361), [#7391](https://github.com/decaporg/decap-cms/issues/7391), [#7393](https://github.com/decaporg/decap-cms/issues/7393), [#7470](https://github.com/decaporg/decap-cms/issues/7470), [#7475](https://github.com/decaporg/decap-cms/issues/7475), [#7480](https://github.com/decaporg/decap-cms/issues/7480), [#7503](https://github.com/decaporg/decap-cms/issues/7503), [#7504](https://github.com/decaporg/decap-cms/issues/7504), [#7524](https://github.com/decaporg/decap-cms/issues/7524), [#7531](https://github.com/decaporg/decap-cms/issues/7531), [#7535](https://github.com/decaporg/decap-cms/issues/7535), [#7553](https://github.com/decaporg/decap-cms/issues/7553)
|
|
1752
1830
|
|
|
1753
1831
|
[^74]: Netlify/Decap CMS [#4209](https://github.com/decaporg/decap-cms/issues/4209)
|
|
1754
1832
|
|