@sveltia/cms 0.25.1 → 0.26.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 +12 -1
- package/dist/sveltia-cms.js +85 -85
- package/dist/sveltia-cms.mjs +91 -91
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -137,6 +137,7 @@ We are working hard to create a **significantly better alternative to Netlify CM
|
|
|
137
137
|
- You can hide the preview of a specific field with `preview: false`.
|
|
138
138
|
- Fields with validation errors are automatically expanded if they are part of nested, collapsed objects[^40].
|
|
139
139
|
- When you click on a field in the Preview pane, the corresponding field in the Editor pane is highlighted. It will be automatically expanded if collapsed[^41].
|
|
140
|
+
- You can use a full regular expression, including flags, for the widget `pattern` option[^82]. For example, if you want to allow 280 characters or less in the multiline Text widget, you could write `/^.{0,280}$/s`.
|
|
140
141
|
- A long validation error message is displayed in full, without being hidden behind the field label[^59].
|
|
141
142
|
|
|
142
143
|
### Better data output
|
|
@@ -444,7 +445,7 @@ collections:
|
|
|
444
445
|
i18n: true
|
|
445
446
|
```
|
|
446
447
|
|
|
447
|
-
With this configuration, an entry is saved with localized filenames, while the default locale’s slug is stored in each file as
|
|
448
|
+
With this configuration, an entry is saved with localized filenames, while the default locale’s slug is stored in each file as an extra `translationKey` property, which is used in [Hugo’s multilingual support](https://gohugo.io/content-management/multilingual/#bypassing-default-linking). Sveltia CMS and Hugo read this property to link localized files.
|
|
448
449
|
|
|
449
450
|
- `data/posts/en/my-trip-to-new-york.yaml`
|
|
450
451
|
```yaml
|
|
@@ -457,6 +458,15 @@ With this configuration, an entry is saved with localized filenames, while the d
|
|
|
457
458
|
translationKey: my-trip-to-new-york
|
|
458
459
|
```
|
|
459
460
|
|
|
461
|
+
You can customize the property name and value for a different framework or i18n library by adding the `canonical_slug` option to your top-level or per-collection `i18n` configuration. The example below is for [`@astrolicious/i18n`](https://github.com/astrolicious/i18n) ([demo](https://github.com/CarloBu/astrolicious-i18n-demo)), which requires a locale prefix in the value:
|
|
462
|
+
|
|
463
|
+
```yaml
|
|
464
|
+
i18n:
|
|
465
|
+
canonical_slug:
|
|
466
|
+
key: defaultLocaleVersion # default: translationKey
|
|
467
|
+
value: 'en/{{slug}}' # default: {{slug}}
|
|
468
|
+
```
|
|
469
|
+
|
|
460
470
|
### Disabling non-default locale content
|
|
461
471
|
|
|
462
472
|
You can now disable output of content in selected non-default locales by adding the `save_all_locales` property to the top-level or per-collection `i18n` configuration. Then you’ll find “Disable (locale name)” in the three-dot menu in the top right corner of the content editor. This is useful if the translation isn’t ready yet, but you want to publish the default locale content first.
|
|
@@ -728,4 +738,5 @@ This software is provided “as is” without any express or implied warranty. W
|
|
|
728
738
|
[^79]: Netlify/Decap CMS [#5726](https://github.com/decaporg/decap-cms/issues/5726)
|
|
729
739
|
[^80]: Netlify/Decap CMS [#5493](https://github.com/decaporg/decap-cms/issues/5493), [#6600](https://github.com/decaporg/decap-cms/issues/6600)
|
|
730
740
|
[^81]: Netlify/Decap CMS [#4645](https://github.com/decaporg/decap-cms/issues/4645)
|
|
741
|
+
[^82]: Netlify/Decap CMS [#6500](https://github.com/decaporg/decap-cms/issues/6500)
|
|
731
742
|
[^100]: Netlify/Decap CMS [#5656](https://github.com/decaporg/decap-cms/issues/5656), [#5837](https://github.com/decaporg/decap-cms/issues/5837), [#5972](https://github.com/decaporg/decap-cms/issues/5972), [#6476](https://github.com/decaporg/decap-cms/issues/6476), [#6516](https://github.com/decaporg/decap-cms/issues/6516), [#6930](https://github.com/decaporg/decap-cms/issues/6930), [#6965](https://github.com/decaporg/decap-cms/issues/6965), [#7080](https://github.com/decaporg/decap-cms/issues/7080), [#7105](https://github.com/decaporg/decap-cms/issues/7105), [#7106](https://github.com/decaporg/decap-cms/issues/7106), [#7119](https://github.com/decaporg/decap-cms/issues/7119), [#7176](https://github.com/decaporg/decap-cms/issues/7176), [#7194](https://github.com/decaporg/decap-cms/issues/7194) — These `removeChild` crashes are common in React apps and seem to be caused by a [browser extension](https://github.com/facebook/react/issues/17256) or [Google Translate](https://github.com/facebook/react/issues/11538).
|