@sveltia/cms 0.25.0 → 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 CHANGED
@@ -63,7 +63,7 @@ We are working hard to create a **significantly better alternative to Netlify CM
63
63
 
64
64
  ### Better productivity
65
65
 
66
- - You can [work with a local Git repository](#working-with-a-local-git-repository) without any configuration or proxy server[^26].
66
+ - You can [work with a local Git repository](#working-with-a-local-git-repository) without any extra configuration or proxy server[^26].
67
67
  - In addition to a streamlined workflow, it offers great performance by loading files natively through the browser rather than using a slow, ad hoc REST API.
68
68
  - It also avoids a number of issues, including the 30 MB file size limit[^51], an unknown error with `publish_mode`[^75], and an unused `logo_url`[^49].
69
69
  - Eliminates some workflow disruptions in the Content Editor:
@@ -104,7 +104,7 @@ We are working hard to create a **significantly better alternative to Netlify CM
104
104
 
105
105
  ### Better i18n support
106
106
 
107
- - Sveltia CMS has been built with a multilingual architecture from the very beginning. You can expect top-notch i18n support, as it’s required by clients of maintainer [@kyoshino](https://github.com/kyoshino), who himself was a long-time Japanese localizer for Mozilla.
107
+ - Sveltia CMS has been built with a multilingual architecture from the very beginning. You can expect top-notch i18n support, as it’s required by clients of maintainer [@kyoshino](https://github.com/kyoshino), who himself was a long-time Japanese localizer for Mozilla and currently lives in a [city](https://en.wikipedia.org/wiki/Toronto) where 150+ languages are spoken.
108
108
  - You can easily switch between locales while editing with just a click on a button instead of a dropdown list.
109
109
  - Fields in non-default locales are validated as expected[^13].
110
110
  - Boolean, DateTime, List and Number fields in the entry preview are displayed in a localized format.
@@ -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
@@ -425,6 +426,10 @@ i18n:
425
426
  structure: multiple_folders
426
427
  locales: [en, fr]
427
428
 
429
+ slug:
430
+ encoding: ascii
431
+ clean_accents: true
432
+
428
433
  collections:
429
434
  - name: posts
430
435
  label: Blog posts
@@ -432,6 +437,7 @@ collections:
432
437
  folder: data/posts/
433
438
  slug: '{{title | localize}}'
434
439
  format: yaml
440
+ i18n: true
435
441
  fields:
436
442
  - name: title
437
443
  label: Title
@@ -439,7 +445,7 @@ collections:
439
445
  i18n: true
440
446
  ```
441
447
 
442
- With this configuration, an entry is saved with localized filenames, while the default locale’s slug is stored in each file as the extra `translationKey` property, which is used in [Hugo’s multilingual support](https://gohugo.io/content-management/multilingual/#bypassing-default-linking). Even if you’re using a different framework, you can still use this property to link localized files.
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.
443
449
 
444
450
  - `data/posts/en/my-trip-to-new-york.yaml`
445
451
  ```yaml
@@ -452,6 +458,15 @@ With this configuration, an entry is saved with localized filenames, while the d
452
458
  translationKey: my-trip-to-new-york
453
459
  ```
454
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
+
455
470
  ### Disabling non-default locale content
456
471
 
457
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.
@@ -723,4 +738,5 @@ This software is provided “as is” without any express or implied warranty. W
723
738
  [^79]: Netlify/Decap CMS [#5726](https://github.com/decaporg/decap-cms/issues/5726)
724
739
  [^80]: Netlify/Decap CMS [#5493](https://github.com/decaporg/decap-cms/issues/5493), [#6600](https://github.com/decaporg/decap-cms/issues/6600)
725
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)
726
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).