@sveltia/cms 0.98.2 → 0.99.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
@@ -73,6 +73,7 @@ Welcome to the only Netlify CMS successor you can trust!
73
73
  - [Including Hugo’s special index file in a folder collection](#including-hugos-special-index-file-in-a-folder-collection)
74
74
  - [Using singletons](#using-singletons)
75
75
  - [Using keyboard shortcuts](#using-keyboard-shortcuts)
76
+ - [Controlling entry file paths](#controlling-entry-file-paths)
76
77
  - [Translating entry fields with one click](#translating-entry-fields-with-one-click)
77
78
  - [Localizing entry slugs](#localizing-entry-slugs)
78
79
  - [Disabling non-default locale content](#disabling-non-default-locale-content)
@@ -196,7 +197,7 @@ Note: This lengthy section compares Sveltia CMS with both Netlify CMS and Decap
196
197
  ### Better productivity
197
198
 
198
199
  - Developers can [work with a local Git repository](#working-with-a-local-git-repository) without any additional configuration or proxy server, resulting in a streamlined workflow and improved performance.[^26]
199
- - It also avoids a number of issues, including potential dependency corruption,[^158] a 30 MB file size limit,[^51] an unknown error with `publish_mode`,[^75] and an unused `logo_url`.[^49]
200
+ - It also avoids a number of issues, including potential security issues,[^158][^282] a 30 MB file size limit,[^51] an unknown error with `publish_mode`,[^75] and an unused `logo_url`.[^49]
200
201
  - When you delete an entry or an asset file, the empty folder that contains it is also deleted, so you don’t have to delete it manually.
201
202
  - Provides a smoother user experience in the Content Editor:
202
203
  - A local backup of an entry draft is automatically created without interruption by a confirmation dialog, which annoys users and can cause a page navigation problem if dismissed.[^106] The backup can then be reliably restored without unexpected overwriting.[^85]
@@ -229,7 +230,7 @@ Note: This lengthy section compares Sveltia CMS with both Netlify CMS and Decap
229
230
  - The `same-origin` referrer policy is automatically set with a `<meta>` tag.
230
231
  - Sveltia CMS has a [secure context](https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts) requirement that forces the site content, including the CMS configuration file, to be served over HTTPS.
231
232
  - GitHub commits are automatically GPG-signed and [marked as verified](https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification).[^144]
232
- - Our [local repository workflow](#working-with-a-local-git-repository) doesn’t require a proxy server, reducing an attack surface.[^158]
233
+ - Our [local repository workflow](#working-with-a-local-git-repository) doesn’t require a proxy server, reducing an attack surface.[^158][^282]
233
234
 
234
235
  ### Better installation
235
236
 
@@ -275,8 +276,9 @@ Sveltia CMS has been built with a multilingual architecture from the very beginn
275
276
  - The [i18n limitations](https://decapcms.org/docs/i18n/#limitations) in Netlify/Decap CMS do not apply to Sveltia CMS:
276
277
  - File collections support multiple files/folders i18n structures.[^87] To enable it, simply use the `{{locale}}` template tag in the `file` path option, e.g. `content/pages/about.{{locale}}.json` or `content/pages/{{locale}}/about.json`. For backward compatibility, the global `structure` option only applies to folder collections, and the default i18n structure for file collections remains single file.
277
278
  - The List and Object widgets support the `i18n: duplicate` field configuration so that changes made with these widgets are duplicated between locales.[^7][^68] The `i18n` configuration can normally be used for the subfields.
278
- - The new `multiple_folders_i18n_root` i18n structure allows to have locale folders below the project root: `<locale>/<folder>/<slug>.<extension>`.[^182]
279
- - The new `omit_default_locale_from_filename` i18n option allows to exclude the default locale from filenames. This option applies to entry collections with the `multiple_files` i18n structure enabled, as well as to file collection items with the `file` path ending with `.{{locale}}.<extension>`, aiming to support [Zola’s multilingual sites](https://www.getzola.org/documentation/content/multilingual/). ([Discussion](https://github.com/sveltia/sveltia-cms/discussions/394))
279
+ - Gives more control over [entry file paths](#controlling-entry-file-paths):
280
+ - The new `multiple_folders_i18n_root` i18n structure allows to have locale folders below the project root: `/<locale>/<folder>/<path>.<extension>`.[^182]
281
+ - The new `omit_default_locale_from_filename` i18n option allows to exclude the default locale from filenames. This option applies to entry collections with the `multiple_files` i18n structure enabled, as well as to file collection items with the `file` path ending with `.{{locale}}.<extension>`, aiming to support [Zola’s multilingual sites](https://www.getzola.org/documentation/content/multilingual/). ([Discussion](https://github.com/sveltia/sveltia-cms/discussions/394))
280
282
  - The `required` field option accepts an array of locale codes in addition to a boolean, making the field required for a subset of locales when i18n support is enabled. For example, if only English is required, you could write `required: [en]`. An empty array is equivalent to `required: false`.
281
283
  - [Entry-relative media folders](https://decapcms.org/docs/collection-folder/#media-and-public-folder) can be used in conjunction with the `multiple_folders` i18n structure.[^21]
282
284
  - The `{{locale}}` template tag can be used in the [`preview_path`](https://decapcms.org/docs/configuration-options/#preview_path) collection option to provide site preview links for each language.[^63]
@@ -583,6 +585,7 @@ Sveltia CMS supports all the [built-in widgets](https://decapcms.org/docs/widget
583
585
  - Field validation works as expected.[^279]
584
586
  - No error is raised in the browser console saying `Sent invalid data to remark`.[^280]
585
587
  - No error is raised in the browser console saying `onValidate is not a function`.[^281]
588
+ - Developers can specify the URL to redirect users after logging out with the `logout_redirect_url` global option.[^283]
586
589
 
587
590
  ### Better localization
588
591
 
@@ -1047,6 +1050,56 @@ If you want to reference a singleton file with a Relation field, use `_singleton
1047
1050
 
1048
1051
  Standard keyboard shortcuts are also available in the Markdown editor, including `Ctrl+B`/`Command+B` for bold text, `Ctrl+I`/`Command+I` for italics, and `Tab` to indent a list item.
1049
1052
 
1053
+ ### Controlling entry file paths
1054
+
1055
+ A [folder collection](https://decapcms.org/docs/collection-folder/)’s file path is determined by multiple factors: the `i18n`, `folder`, `path`, `slug` and `extension` options. The configuration can be complex, especially with i18n support, so let’s break it down.
1056
+
1057
+ - The [`i18n`](https://decapcms.org/docs/i18n/) global or collection option (optional)
1058
+ - It can be configured to add internationalization (i18n) support to your site.
1059
+ - The `structure` and `omit_default_locale_from_filename` options affect the entry file path.
1060
+ - The `folder` collection option (required)
1061
+ - It specifies the folder where the collection entries are stored, relative to the repository’s root directory.
1062
+ - It can contain slashes to create a nested folder structure.
1063
+ - The [`path`](https://decapcms.org/docs/collection-folder/#folder-collections-path) collection option (optional)
1064
+ - It defaults to `{{slug}}`, which is the `slug` collection option value.
1065
+ - It can contain template tags.
1066
+ - It can also contain slashes to create a nested folder structure.
1067
+ - The [`slug`](https://decapcms.org/docs/configuration-options/#slug) collection option (optional)
1068
+ - It defaults to `{{title}}`, which is the entry’s `title` field value’s slugified version.
1069
+ - It can also contain template tags but _cannot_ contain slashes.
1070
+ - The [`extension`](https://decapcms.org/docs/configuration-options/#extension-and-format) collection option (optional)
1071
+ - It defaults to `md`.
1072
+
1073
+ Looking at the above options, the entry file path can be constructed as follows:
1074
+
1075
+ - With i18n disabled:
1076
+ ```yaml
1077
+ /<folder>/<path>.<extension>
1078
+ ```
1079
+ - With the `single_file` i18n structure
1080
+ ```yaml
1081
+ /<folder>/<path>.<extension>
1082
+ ```
1083
+ - With the `multiple_files` i18n structure:
1084
+ ```yaml
1085
+ /<folder>/<path>.<locale>.<extension>
1086
+ ```
1087
+ When the `omit_default_locale_from_filename` i18n option is set to `true`, the path depends on the locale:
1088
+ ```yaml
1089
+ /<folder>/<path>.<extension> # default locale
1090
+ /<folder>/<path>.<locale>.<extension> # other locales
1091
+ ```
1092
+ - With the `multiple_folders` i18n structure:
1093
+ ```yaml
1094
+ /<folder>/<locale>/<path>.<extension>
1095
+ ```
1096
+ - With the `multiple_folders_i18n_root` i18n structure:
1097
+ ```yaml
1098
+ /<locale>/<folder>/<path>.<extension>
1099
+ ```
1100
+
1101
+ The configuration for a [file collection](https://decapcms.org/docs/collection-file/) and [singleton collection](#using-singletons) is much simpler, as it only requires the `file` option to specify the complete file path, including the folder, filename and extension. It can also include the `{{locale}}` template tag for i18n support.
1102
+
1050
1103
  ### Translating entry fields with one click
1051
1104
 
1052
1105
  Sveltia CMS comes with a handy translation API integration so that you can translate any text field from another locale without leaving the Content Editor. Currently, Google’s Cloud Translation and OpenAI’s GPT-3.5 Turbo are supported. To enable the quick translation feature:
@@ -1967,7 +2020,7 @@ This software is provided “as is” without any express or implied warranty. W
1967
2020
 
1968
2021
  [^112]: Netlify/Decap CMS [#5815](https://github.com/decaporg/decap-cms/issues/5815), [#6522](https://github.com/decaporg/decap-cms/issues/6522), [#6532](https://github.com/decaporg/decap-cms/issues/6532), [#6588](https://github.com/decaporg/decap-cms/issues/6588), [#6617](https://github.com/decaporg/decap-cms/issues/6617), [#6640](https://github.com/decaporg/decap-cms/issues/6640), [#6663](https://github.com/decaporg/decap-cms/issues/6663), [#6695](https://github.com/decaporg/decap-cms/issues/6695), [#6697](https://github.com/decaporg/decap-cms/issues/6697), [#6764](https://github.com/decaporg/decap-cms/issues/6764), [#6765](https://github.com/decaporg/decap-cms/issues/6765), [#6835](https://github.com/decaporg/decap-cms/issues/6835), [#6983](https://github.com/decaporg/decap-cms/issues/6983), [#7205](https://github.com/decaporg/decap-cms/issues/7205), [#7450](https://github.com/decaporg/decap-cms/issues/7450), [#7453](https://github.com/decaporg/decap-cms/issues/7453), [#7572](https://github.com/decaporg/decap-cms/issues/7572)
1969
2022
 
1970
- [^113]: 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), [#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), [#7244](https://github.com/decaporg/decap-cms/issues/7244), [#7278](https://github.com/decaporg/decap-cms/issues/7278), [#7301](https://github.com/decaporg/decap-cms/issues/7301), [#7342](https://github.com/decaporg/decap-cms/issues/7342), [#7348](https://github.com/decaporg/decap-cms/issues/7348), [#7354](https://github.com/decaporg/decap-cms/issues/7354), [#7376](https://github.com/decaporg/decap-cms/issues/7376), [#7408](https://github.com/decaporg/decap-cms/issues/7408), [#7412](https://github.com/decaporg/decap-cms/issues/7412), [#7413](https://github.com/decaporg/decap-cms/issues/7413), [#7422](https://github.com/decaporg/decap-cms/issues/7422), [#7427](https://github.com/decaporg/decap-cms/issues/7427), [#7434](https://github.com/decaporg/decap-cms/issues/7434), [#7438](https://github.com/decaporg/decap-cms/issues/7438), [#7454](https://github.com/decaporg/decap-cms/issues/7454), [#7464](https://github.com/decaporg/decap-cms/issues/7464), [#7471](https://github.com/decaporg/decap-cms/issues/7471), [#7485](https://github.com/decaporg/decap-cms/issues/7485), [#7499](https://github.com/decaporg/decap-cms/issues/7499), [#7515](https://github.com/decaporg/decap-cms/issues/7515), [#7564](https://github.com/decaporg/decap-cms/issues/7564), [#7571](https://github.com/decaporg/decap-cms/issues/7571), [#7574](https://github.com/decaporg/decap-cms/issues/7574) — These `removeChild` crashes are common in React apps, likely caused by a [browser extension](https://github.com/facebook/react/issues/17256) or [Google Translate](https://github.com/facebook/react/issues/11538).
2023
+ [^113]: 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), [#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), [#7244](https://github.com/decaporg/decap-cms/issues/7244), [#7278](https://github.com/decaporg/decap-cms/issues/7278), [#7301](https://github.com/decaporg/decap-cms/issues/7301), [#7342](https://github.com/decaporg/decap-cms/issues/7342), [#7348](https://github.com/decaporg/decap-cms/issues/7348), [#7354](https://github.com/decaporg/decap-cms/issues/7354), [#7376](https://github.com/decaporg/decap-cms/issues/7376), [#7408](https://github.com/decaporg/decap-cms/issues/7408), [#7412](https://github.com/decaporg/decap-cms/issues/7412), [#7413](https://github.com/decaporg/decap-cms/issues/7413), [#7422](https://github.com/decaporg/decap-cms/issues/7422), [#7427](https://github.com/decaporg/decap-cms/issues/7427), [#7434](https://github.com/decaporg/decap-cms/issues/7434), [#7438](https://github.com/decaporg/decap-cms/issues/7438), [#7454](https://github.com/decaporg/decap-cms/issues/7454), [#7464](https://github.com/decaporg/decap-cms/issues/7464), [#7471](https://github.com/decaporg/decap-cms/issues/7471), [#7485](https://github.com/decaporg/decap-cms/issues/7485), [#7499](https://github.com/decaporg/decap-cms/issues/7499), [#7515](https://github.com/decaporg/decap-cms/issues/7515), [#7564](https://github.com/decaporg/decap-cms/issues/7564), [#7571](https://github.com/decaporg/decap-cms/issues/7571), [#7574](https://github.com/decaporg/decap-cms/issues/7574), [#7580](https://github.com/decaporg/decap-cms/issues/7580) — These `removeChild` crashes are common in React apps, likely caused by a [browser extension](https://github.com/facebook/react/issues/17256) or [Google Translate](https://github.com/facebook/react/issues/11538).
1971
2024
 
1972
2025
  [^114]: Netlify/Decap CMS [#5029](https://github.com/decaporg/decap-cms/issues/5029), [#5048](https://github.com/decaporg/decap-cms/issues/5048)
1973
2026
 
@@ -2304,3 +2357,7 @@ This software is provided “as is” without any express or implied warranty. W
2304
2357
  [^280]: Netlify/Decap CMS [#3490](https://github.com/decaporg/decap-cms/issues/3490), [#3682](https://github.com/decaporg/decap-cms/issues/3682), [#4669](https://github.com/decaporg/decap-cms/issues/4669), [#4895](https://github.com/decaporg/decap-cms/issues/4895), [#4976](https://github.com/decaporg/decap-cms/issues/4976), [#5766](https://github.com/decaporg/decap-cms/issues/5766), [#6501](https://github.com/decaporg/decap-cms/issues/6501), [#6785](https://github.com/decaporg/decap-cms/issues/6785), [#7315](https://github.com/decaporg/decap-cms/issues/7315)
2305
2358
 
2306
2359
  [^281]: Netlify/Decap CMS [#4892](https://github.com/decaporg/decap-cms/issues/4892) — We cannot reproduce the crash, but we do see the error message in the console.
2360
+
2361
+ [^282]: Netlify/Decap CMS [#7579](https://github.com/decaporg/decap-cms/pull/7579)
2362
+
2363
+ [^283]: Netlify/Decap CMS [#713](https://github.com/decaporg/decap-cms/issues/713)