@sveltia/cms 0.87.2 → 0.87.4
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 +87 -42
- package/dist/sveltia-cms.js +202 -200
- package/dist/sveltia-cms.js.map +1 -1
- package/dist/sveltia-cms.mjs +206 -204
- package/dist/sveltia-cms.mjs.map +1 -1
- package/package.json +1 -1
- package/schema/sveltia-cms.json +1387 -842
- package/types/public.d.ts +217 -149
package/README.md
CHANGED
|
@@ -52,6 +52,7 @@ The free, open source alternative/successor to Netlify/Decap CMS is now in publi
|
|
|
52
52
|
- [Getting started](#getting-started)
|
|
53
53
|
- [Installation \& setup](#installation--setup)
|
|
54
54
|
- [Migration](#migration)
|
|
55
|
+
- [Editing the configuration file](#editing-the-configuration-file)
|
|
55
56
|
- [Migrating from Git Gateway backend](#migrating-from-git-gateway-backend)
|
|
56
57
|
- [Installing with npm](#installing-with-npm)
|
|
57
58
|
- [Updates](#updates)
|
|
@@ -111,7 +112,7 @@ Due to its unfortunate abandonment in early 2022, Netlify CMS spawned 3 successo
|
|
|
111
112
|
- **Sveltia CMS**: not a fork but a **complete rewrite** or “total reboot”, started in November 2022, first appeared on GitHub in March 2023
|
|
112
113
|
- [Decap CMS](https://github.com/decaporg/decap-cms): a rebranded version, [announced in February 2023](https://www.netlify.com/blog/netlify-cms-to-become-decap-cms/) as the official successor with a Netlify agency partner taking ownership — mostly stagnant, with only occasional releases
|
|
113
114
|
|
|
114
|
-
Sveltia CMS is the only project that doesn’t inherit the complexity, technical debt, and numerous bugs of Netlify CMS, which was launched in 2015. Our product is better by design: We rebuilt the app from the ground up using a [modern framework](https://svelte.dev/)
|
|
115
|
+
Sveltia CMS is the only project that doesn’t inherit the complexity, technical debt, and numerous bugs of Netlify CMS, which was launched in 2015. Our product is better by design: We have rebuilt the app from the ground up using a [modern framework](https://svelte.dev/) while closely monitoring and analyzing the Netlify/Decap CMS issue tracker. We don’t use any of the predecessor’s code. This allows us to make [hundreds of improvements](#differentiators) without getting stuck in the old system.
|
|
115
116
|
|
|
116
117
|
While Sveltia CMS was created to replace legacy Netlify CMS instances, it can also be used as an alternative to other Netlify CMS successors. With its [solid i18n support](#better-i18n-support), we’re hoping our product will eventually be an appearing option for anyone looking for a free headless CMS.
|
|
117
118
|
|
|
@@ -226,15 +227,16 @@ Note: This lengthy section compares Sveltia CMS with both Netlify CMS and Decap
|
|
|
226
227
|
|
|
227
228
|
- Sveltia CMS is built with [Svelte](https://svelte.dev/), and we only publish compiled vanilla JavaScript bundles, so there are no React compatibility issues that might prevent developers from upgrading a project for many months.[^177] We haven’t actually integrated React for custom widgets and other features yet, but anyway, no dependencies will be installed when you [install the app with npm](#installing-with-npm).
|
|
228
229
|
- Sveltia CMS also won’t cause peer dependency conflicts mainly due to legacy third-party React UI libraries.[^175][^237] We build the app using [our own Svelte UI component library](https://github.com/sveltia/sveltia-ui) to reduce reliance on third parties.
|
|
229
|
-
- Some servers and frameworks are known to remove the trailing slash from the CMS URL (`/admin`) depending on the configuration. In such cases, the config file is loaded from
|
|
230
|
+
- Some servers and frameworks are known to remove the trailing slash from the CMS URL (`/admin`) depending on the configuration. In such cases, the config file is loaded from the proper URL (`/admin/config.yml`) instead of a regular relative URL (`./config.yml` = `/config.yml`), which results in a 404 Not Found error.[^107]
|
|
230
231
|
- The [robots `meta` tag](https://developers.google.com/search/docs/crawling-indexing/robots-meta-tag) is automatically added to HTML to prevent the admin page from being indexed by search engines.[^174] Developers are still encouraged to manually add `<meta name="robots" content="noindex">` to `index.html`, as not all crawlers support dynamically added tags. However, our solution should at least work with Google in case you forget to do so.
|
|
231
|
-
- Initializing the CMS twice (due to the incorrect or missing placement of `CMS_MANUAL_INIT`) will not result in a `NotFoundError`.[^251]
|
|
232
|
+
- Initializing the CMS twice (due to the incorrect or missing placement of `window.CMS_MANUAL_INIT`) will not result in a `NotFoundError`.[^251]
|
|
233
|
+
- Sveltia CMS automatically enables [manual initialization](https://decapcms.org/docs/manual-initialization/) when you import the JavaScript module, so you don’t need to have `window.CMS_MANUAL_INIT = true` in your code.
|
|
232
234
|
|
|
233
235
|
### Better configuration
|
|
234
236
|
|
|
235
|
-
- We provide [our own JSON schema](#enabling-autocomplete-and-validation-for-the-configuration-file) for the YAML configuration file, which enables autocomplete and validation in IDEs such as VS Code.[^253]
|
|
236
237
|
- Sveltia CMS supports a [JSON configuration file](#providing-a-json-configuration-file) that can be generated for bulk or complex collections.[^60]
|
|
237
238
|
- Also supports [multiple configuration files](#providing-multiple-configuration-files) to allow developers to modularize the configuration.[^197]
|
|
239
|
+
- We provide an [up-to-date JSON schema](#enabling-autocomplete-and-validation-for-the-configuration-file) for YAML/JSON configuration files, which enables autocomplete and validation in VS Code and other code editors.[^253]
|
|
238
240
|
- Improved TypeScript support: We keep our type definitions for `CMS.init()` and other methods complete, accurate, up-to-date and annotated.[^190][^191][^192][^193][^227] This makes it easier to provide a site config object when [manually initializing](https://decapcms.org/docs/manual-initialization/) the CMS.
|
|
239
241
|
|
|
240
242
|
### Better backend support
|
|
@@ -256,7 +258,7 @@ Note: This lengthy section compares Sveltia CMS with both Netlify CMS and Decap
|
|
|
256
258
|
|
|
257
259
|
### Better i18n support
|
|
258
260
|
|
|
259
|
-
Sveltia CMS has been built with a multilingual architecture from the very beginning. You can expect
|
|
261
|
+
Sveltia CMS has been built with a multilingual architecture from the very beginning. You can expect first-class internationalization (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](https://www.mozilla.org/) and currently lives in the [most diverse city in the world](https://en.wikipedia.org/wiki/Toronto) where 150+ languages are spoken.
|
|
260
262
|
|
|
261
263
|
- Configuration
|
|
262
264
|
- The [i18n limitations](https://decapcms.org/docs/i18n/#limitations) in Netlify/Decap CMS do not apply to Sveltia CMS:
|
|
@@ -278,8 +280,6 @@ Sveltia CMS has been built with a multilingual architecture from the very beginn
|
|
|
278
280
|
- Language labels appear in human-readable display names instead of ISO 639 language codes because it’s not easy for everyone to recognize `DE` as German, `NL` as Dutch, `ZH` as Chinese, and so on.
|
|
279
281
|
- Content editing
|
|
280
282
|
- [Integrates a translation service](#translating-entry-fields-with-one-click) to allow translation of text fields from another locale with one click.
|
|
281
|
-
- Earlier versions of Sveltia CMS included DeepL integration, but it’s disabled for now [due to an API limitation](https://github.com/sveltia/sveltia-cms/issues/437).
|
|
282
|
-
- More translation services will be added in the future.
|
|
283
283
|
- The Content Editor supports [RTL scripts](https://en.wikipedia.org/wiki/Right-to-left_script) such as Arabic, Hebrew and Persian.[^146]
|
|
284
284
|
- It’s possible to [disable non-default locale content](#disabling-non-default-locale-content).[^15]
|
|
285
285
|
- Boolean, DateTime, List and Number fields in the entry preview are displayed in a localized format.
|
|
@@ -399,8 +399,6 @@ Sveltia CMS has been built with a multilingual architecture from the very beginn
|
|
|
399
399
|
|
|
400
400
|
Sveltia CMS supports all [built-in widgets](https://decapcms.org/docs/widgets/) available in Netlify/Decap CMS. We have made significant improvements to these widgets while adding some new ones. Support for [custom widgets](https://decapcms.org/docs/custom-widgets/) will be added before the 1.0 release.
|
|
401
401
|
|
|
402
|
-
Note: The Date widget has been deprecated in Netlify CMS and removed from both Decap CMS and Sveltia CMS in favour of the DateTime widget, as noted in the [Compatibility](#compatibility) section.
|
|
403
|
-
|
|
404
402
|
- Boolean
|
|
405
403
|
- A required Boolean field with no default value is saved as `false` by default, without raising a confusing validation error.[^45]
|
|
406
404
|
- An optional Boolean field with no default value is also saved as `false` by default, rather than nothing.[^46]
|
|
@@ -437,7 +435,7 @@ Note: The Date widget has been deprecated in Netlify CMS and removed from both D
|
|
|
437
435
|
- A collapsed List field will not display a programmatic summary like `List [ Map { "key": "value" } ]` if the `summary` option is not set.[^183]
|
|
438
436
|
- Map
|
|
439
437
|
- A search bar enables users to quickly locate a specific place on the map.[^252]
|
|
440
|
-
- With the [Geolocation API](https://developer.mozilla.org/en-US/docs/Web/API/Geolocation_API),
|
|
438
|
+
- With the [Geolocation API](https://developer.mozilla.org/en-US/docs/Web/API/Geolocation_API), users can get their current location with one click.
|
|
441
439
|
- The value can be cleared if the field is optional.
|
|
442
440
|
- The map’s zoom level is adjusted more intuitively using pinch gestures.
|
|
443
441
|
- The map looks good in dark mode.
|
|
@@ -568,7 +566,7 @@ Note: The Date widget has been deprecated in Netlify CMS and removed from both D
|
|
|
568
566
|
|
|
569
567
|
We are trying to make Sveltia CMS compatible with Netlify/Decap CMS where possible, so that more users can seamlessly switch to our modern alternative. It’s ready to be used as a drop-in replacement for Netlify/Decap CMS in some casual use case scenarios with a [single line of code update](#migration).
|
|
570
568
|
|
|
571
|
-
However, 100% feature parity is
|
|
569
|
+
However, 100% feature parity is never planned, and some features are still missing or will not be added due to performance, deprecation and other factors. Look at the compatibility info below to see if you can migrate now or in the near future.
|
|
572
570
|
|
|
573
571
|
### Features not to be implemented
|
|
574
572
|
|
|
@@ -599,7 +597,7 @@ However, 100% feature parity is not planned, and some features are still missing
|
|
|
599
597
|
|
|
600
598
|
### Current limitations
|
|
601
599
|
|
|
602
|
-
These Netlify/Decap CMS features are not yet implemented in Sveltia CMS. We are working hard to add them before the 1.0 release due late 2025. Check
|
|
600
|
+
These Netlify/Decap CMS features are not yet implemented in Sveltia CMS. We are working hard to add them before the 1.0 release due late 2025. Check our [release notes](https://github.com/sveltia/sveltia-cms/releases) and [Bluesky](https://bsky.app/profile/sveltiacms.app) for updates.
|
|
603
601
|
|
|
604
602
|
- Comprehensive site config validation
|
|
605
603
|
- [Localization](https://github.com/sveltia/sveltia-cms/blob/main/src/lib/locales/README.md) other than English and Japanese
|
|
@@ -633,7 +631,7 @@ Sveltia CMS provides partial compatibility with [Static CMS](https://github.com/
|
|
|
633
631
|
- I18n support
|
|
634
632
|
- The `enforce_required_non_default` i18n option will not be supported. Sveitia CMS enforces required fields in all locales by default. However, the `save_all_locales` or `initial_locales` i18n option allows users to [disable non-default locales](#disabling-non-default-locale-content) if needed. Developers can also specify a subset of locales with the `required` field option, e.g. `required: [en]`.
|
|
635
633
|
- Widgets
|
|
636
|
-
- The date/time format options for the DateTime widget are
|
|
634
|
+
- The date/time format options for the DateTime widget are **not compatible** since Static CMS [switched to date-fns](https://staticjscms.netlify.app/docs/decap-migration-guide#dates) while Sveltia CMS continues to use Moment.js (and will soon switch to Day.js). Update your formats accordingly.
|
|
637
635
|
- The KeyValue widget is implemented in Sveltia CMS with the same options.
|
|
638
636
|
- The UUID widget is also implemented, but with different options.
|
|
639
637
|
- The `prefix` and `suffix` options for the Boolean, Number and String widgets are implemented as `before_input` and `after_input` in Sveltia CMS, respectively. Our `prefix` and `suffix` options for the String widget are literally a prefix and suffix to the value.
|
|
@@ -645,7 +643,7 @@ Sveltia CMS provides partial compatibility with [Static CMS](https://github.com/
|
|
|
645
643
|
|
|
646
644
|
While Sveltia CMS is built with Svelte, the application is **framework-agnostic**. It’s a small, compiled, vanilla JavaScript bundle that manages content in a Git repository directly via an API. It doesn’t interact with the framework that builds your site.
|
|
647
645
|
|
|
648
|
-
|
|
646
|
+
As with Netlify/Decap CMS, you can use Sveltia CMS with any framework or static site generator (SSG) that loads static files during the build process. This includes Astro, Eleventy, Hugo, Jekyll, Next.js, SvelteKit, VitePress, and [more](https://decapcms.org/docs/install-decap-cms/).
|
|
649
647
|
|
|
650
648
|
We have added support for features and file structures used in certain frameworks and i18n libraries, such as [index file inclusion](#including-hugos-special-index-file-in-a-folder-collection) and [slug localization](#localizing-entry-slugs) for Hugo, i18n support for Astro and Zola, and [some enhancements](https://github.com/sveltia/sveltia-cms/issues/230) for VitePress. [Let us know](https://github.com/sveltia/sveltia-cms/issues/new?type=feature) if your framework has specific requirements.
|
|
651
649
|
|
|
@@ -715,6 +713,10 @@ Next, let’s [test Sveltia CMS on your local machine](#working-with-a-local-git
|
|
|
715
713
|
|
|
716
714
|
You can now open `https://[hostname]/admin/` as usual to start editing. There is even no authentication process if you’re already signed in with GitHub or GitLab on Netlify/Decap CMS because Sveltia CMS uses your auth token stored in the browser. Simple enough!
|
|
717
715
|
|
|
716
|
+
#### Editing the configuration file
|
|
717
|
+
|
|
718
|
+
For a better DX, we recommend [setting up the JSON schema](#enabling-autocomplete-and-validation-for-the-configuration-file) for the site configuration file in your code editor. If you have the YAML extension installed, VS Code may automatically apply the outdated Netlify CMS config schema to `config.yml`. To use the latest Sveltia CMS config schema instead, you need to specify its URL.
|
|
719
|
+
|
|
718
720
|
#### Migrating from Git Gateway backend
|
|
719
721
|
|
|
720
722
|
Sveltia CMS does not support the Git Gateway backend due to performance limitations. If you don’t care about user management with Netlify Identity, you can use the [GitHub](https://decapcms.org/docs/github-backend/) or [GitLab](https://decapcms.org/docs/gitlab-backend/) backend instead. Make sure **you install an OAuth client** on GitHub or GitLab in addition to updating your configuration file. As noted in the document, Netlify is still able to facilitate the auth flow.
|
|
@@ -737,7 +739,7 @@ For advanced users, we have also made the bundle available as an [npm package](h
|
|
|
737
739
|
|
|
738
740
|
Updating Sveltia CMS is transparent, unless you include a specific version in the `<script>` source URL or use the npm package. Whenever you (re)load the CMS, the latest version will be served via [UNPKG](https://unpkg.com/). The CMS also periodically checks for updates and notifies you when a new version is available. After the product reaches GA, you could use a semantic version range (`^1.0.0`) like Netlify/Decap CMS.
|
|
739
741
|
|
|
740
|
-
If you’ve chosen to install with npm, updating the package is your responsibility. We recommend using [`ncu`](https://www.npmjs.com/package/npm-check-updates) or a service like [Dependabot](https://github.blog/2020-06-01-keep-all-your-packages-up-to-date-with-dependabot/) to keep dependencies up to date,
|
|
742
|
+
If you’ve chosen to install with npm, updating the package is your responsibility. We strongly recommend using [`ncu`](https://www.npmjs.com/package/npm-check-updates) or a service like [Dependabot](https://github.blog/2020-06-01-keep-all-your-packages-up-to-date-with-dependabot/) to keep dependencies up to date. Otherwise, you’ll miss important bug fixes and new features. (ProTip: We update our dependencies using `ncu -u && pnpm up`.)
|
|
741
743
|
|
|
742
744
|
## Tips & tricks
|
|
743
745
|
|
|
@@ -747,9 +749,9 @@ You can host your Sveltia CMS-managed site anywhere, such as [Cloudflare Pages](
|
|
|
747
749
|
|
|
748
750
|
### Enabling autocomplete and validation for the configuration file
|
|
749
751
|
|
|
750
|
-
Sveltia CMS provides
|
|
752
|
+
Sveltia CMS provides a full [JSON schema](https://json-schema.org/) for the configuration file, so you can get autocomplete and validation in your favourite code editor while editing the site configuration. The schema is generated from the source and always up to date with the latest CMS version.
|
|
751
753
|
|
|
752
|
-
If you use
|
|
754
|
+
If you use VS Code, you can enable it for the YAML configuration file by installing the [YAML extension](https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml) and adding the following to your project’s [VS Code settings file](https://code.visualstudio.com/docs/configure/settings#_settings-json-file) at `.vscode/settings.json`:
|
|
753
755
|
|
|
754
756
|
```json
|
|
755
757
|
{
|
|
@@ -759,7 +761,22 @@ If you use [Visual Studio Code](https://code.visualstudio.com/), you can enable
|
|
|
759
761
|
}
|
|
760
762
|
```
|
|
761
763
|
|
|
762
|
-
|
|
764
|
+
If your configuration is in JSON format (see the [next section](#providing-a-json-configuration-file)), no extension is needed. Just add the following to the same VS Code settings file:
|
|
765
|
+
|
|
766
|
+
```json
|
|
767
|
+
{
|
|
768
|
+
"json.schemas": [
|
|
769
|
+
{
|
|
770
|
+
"fileMatch": ["/static/admin/config.json"],
|
|
771
|
+
"url": "https://unpkg.com/@sveltia/cms/schema/sveltia-cms.json"
|
|
772
|
+
}
|
|
773
|
+
]
|
|
774
|
+
}
|
|
775
|
+
```
|
|
776
|
+
|
|
777
|
+
The configuration file location varies by framework and project structure, so adjust the path accordingly. For example, if you use Astro, the file is typically located in the `/public/admin/` directory.
|
|
778
|
+
|
|
779
|
+
If you use another code editor, check its documentation for how to enable JSON schema support for YAML or JSON files. The schema URL is `https://unpkg.com/@sveltia/cms/schema/sveltia-cms.json`.
|
|
763
780
|
|
|
764
781
|
### Providing a JSON configuration file
|
|
765
782
|
|
|
@@ -849,19 +866,19 @@ fields:
|
|
|
849
866
|
|
|
850
867
|
### Adding dividers to the collection list
|
|
851
868
|
|
|
852
|
-
Sveltia CMS
|
|
869
|
+
With Sveltia CMS, developers can add dividers to the collection list to distinguish between different types of collections. To do so, insert a new item with the `divider` option set to `true`. In VS Code, you may receive a validation error if `config.yml` is treated as a Netlify CMS configuration file. You can resolve this issue by [using our JSON schema](#enabling-autocomplete-and-validation-for-the-configuration-file).
|
|
853
870
|
|
|
854
871
|
```yaml
|
|
855
872
|
collections:
|
|
856
873
|
- name: products
|
|
857
874
|
...
|
|
858
875
|
- divider: true
|
|
859
|
-
name: d1 # d2, d3, etc. Should be unique for each divider
|
|
860
|
-
files: []
|
|
861
876
|
- name: pages
|
|
862
877
|
...
|
|
863
878
|
```
|
|
864
879
|
|
|
880
|
+
The [singleton collection](#using-singletons) also supports dividers.
|
|
881
|
+
|
|
865
882
|
### Using a custom media folder for a collection
|
|
866
883
|
|
|
867
884
|
This is actually not new in Sveltia CMS but rather an undocumented feature in Netlify/Decap CMS.[^4] You can specify media and public folders for each collection that override the [global media folder](https://decapcms.org/docs/configuration-options/#media-and-public-folders). Well, it’s [documented](https://decapcms.org/docs/collection-folder/#media-and-public-folder), but that’s probably not what you want.
|
|
@@ -933,7 +950,7 @@ index_file:
|
|
|
933
950
|
preview: false # Hide the preview pane if needed. Default: true
|
|
934
951
|
```
|
|
935
952
|
|
|
936
|
-
If
|
|
953
|
+
If your regular entry fields and index file fields are identical and you don’t need any options, simply write:
|
|
937
954
|
|
|
938
955
|
```yaml
|
|
939
956
|
index_file: true
|
|
@@ -943,42 +960,47 @@ Note that the special index file is placed right under the `folder`, regardless
|
|
|
943
960
|
|
|
944
961
|
### Using singletons
|
|
945
962
|
|
|
946
|
-
The singleton collection is an unnamed, non-nested variant of a [file collection](https://decapcms.org/docs/collection-file/) that can be used to manage
|
|
963
|
+
The singleton collection is an unnamed, non-nested variant of a [file collection](https://decapcms.org/docs/collection-file/) that can be used to manage a set of pre-defined data files. Singleton files appear in the content library’s sidebar under the Files group, and users can open the Content Editor directly without navigating to a file list.
|
|
947
964
|
|
|
948
|
-
To create this special file collection, add the new `singletons` option, along with an array of file definitions, to the root level of your site configuration
|
|
965
|
+
To create this special file collection, add the new `singletons` option, along with an array of file definitions, to the root level of your site configuration.
|
|
966
|
+
|
|
967
|
+
This is a conventional file collection:
|
|
949
968
|
|
|
950
969
|
```yaml
|
|
951
970
|
collections:
|
|
952
|
-
# A conventional file collection
|
|
953
971
|
- name: data
|
|
954
972
|
label: Data
|
|
955
973
|
files:
|
|
956
974
|
- name: home
|
|
957
975
|
label: Home Page
|
|
958
976
|
file: content/home.yaml
|
|
959
|
-
|
|
977
|
+
icon: home
|
|
978
|
+
fields: ...
|
|
960
979
|
- name: settings
|
|
961
980
|
label: Site Settings
|
|
962
981
|
file: content/settings.yaml
|
|
963
|
-
|
|
982
|
+
icon: settings
|
|
983
|
+
fields: ...
|
|
984
|
+
```
|
|
985
|
+
|
|
986
|
+
It can be converted to the singleton collection like this:
|
|
964
987
|
|
|
965
|
-
|
|
988
|
+
```yaml
|
|
966
989
|
singletons:
|
|
967
990
|
- name: home
|
|
968
991
|
label: Home Page
|
|
969
992
|
file: content/home.yaml
|
|
970
|
-
icon: home
|
|
971
|
-
...
|
|
972
|
-
-
|
|
973
|
-
divider: true # You can also add dividers
|
|
993
|
+
icon: home
|
|
994
|
+
fields: ...
|
|
995
|
+
- divider: true # You can add dividers
|
|
974
996
|
- name: settings
|
|
975
997
|
label: Site Settings
|
|
976
998
|
file: content/settings.yaml
|
|
977
999
|
icon: settings
|
|
978
|
-
...
|
|
1000
|
+
fields: ...
|
|
979
1001
|
```
|
|
980
1002
|
|
|
981
|
-
If you want to reference a singleton file with a Relation field, use `_singletons` as the `collection` name.
|
|
1003
|
+
If you want to reference a singleton file with a Relation field, use `_singletons` (note an underscore prefix) as the `collection` name.
|
|
982
1004
|
|
|
983
1005
|
### Using keyboard shortcuts
|
|
984
1006
|
|
|
@@ -1006,6 +1028,8 @@ Sveltia CMS comes with a handy Google Cloud Translation API integration so that
|
|
|
1006
1028
|
|
|
1007
1029
|
Note that the Translation button on the pane header only translates empty fields, while in-field Translation buttons override any filled text.
|
|
1008
1030
|
|
|
1031
|
+
Earlier versions of Sveltia CMS included DeepL integration, but it has been disabled [due to an API limitation](https://github.com/sveltia/sveltia-cms/issues/437). More translation services will be added in the future.
|
|
1032
|
+
|
|
1009
1033
|
### Localizing entry slugs
|
|
1010
1034
|
|
|
1011
1035
|
In Sveltia CMS, it’s possible to localize entry slugs (filenames) if the i18n structure is `multiple_files` or `multiple_folders`. All you need is the `localize` filter for `slug` template tags:
|
|
@@ -1166,7 +1190,7 @@ In case you’re not aware, [WebP](https://developers.google.com/speed/webp) off
|
|
|
1166
1190
|
- The `width` and `height` options are the maximum width and height, respectively. If an image is larger than the specified dimension, it will be scaled down. Smaller images will not be resized.
|
|
1167
1191
|
- File processing is a bit slow on Safari because [native WebP encoding](https://caniuse.com/mdn-api_htmlcanvaselement_toblob_type_parameter_webp) is [not supported](https://bugs.webkit.org/show_bug.cgi?id=183257) and the [jSquash](https://github.com/jamsinclair/jSquash) library is used instead.
|
|
1168
1192
|
- AVIF conversion is not supported because no browser has native AVIF encoding support ([Chromium won’t fix it](https://issues.chromium.org/issues/40848792)) and the third-party library (and AVIF encoding in general) is very slow.
|
|
1169
|
-
- This feature is not intended for creating image variants in different formats and sizes. It should be done with a framework during the build process.
|
|
1193
|
+
- This feature is not intended for creating image variants in different formats and sizes. It should be done with a framework during the build process. Popular frameworks like [Astro](https://docs.astro.build/en/guides/images/), [Eleventy](https://www.11ty.dev/docs/plugins/image/), [Hugo](https://gohugo.io/content-management/image-processing/), [Next.js](https://nextjs.org/docs/pages/api-reference/components/image) and [SvelteKit](https://svelte.dev/docs/kit/images) have built-in image processing capabilities.
|
|
1170
1194
|
- We may add more transformation options in the future.
|
|
1171
1195
|
|
|
1172
1196
|
### Disabling stock assets
|
|
@@ -1191,6 +1215,7 @@ collections:
|
|
|
1191
1215
|
- name: members
|
|
1192
1216
|
label: Member List
|
|
1193
1217
|
file: _data/members.yml
|
|
1218
|
+
icon: group
|
|
1194
1219
|
fields:
|
|
1195
1220
|
- name: members
|
|
1196
1221
|
label: Members
|
|
@@ -1204,13 +1229,34 @@ collections:
|
|
|
1204
1229
|
label: GitHub account
|
|
1205
1230
|
```
|
|
1206
1231
|
|
|
1207
|
-
|
|
1232
|
+
It also works with a [singleton](#using-singletons):
|
|
1233
|
+
|
|
1234
|
+
```yaml
|
|
1235
|
+
singletons:
|
|
1236
|
+
- name: members
|
|
1237
|
+
label: Member List
|
|
1238
|
+
file: _data/members.yml
|
|
1239
|
+
icon: group
|
|
1240
|
+
fields:
|
|
1241
|
+
- name: members
|
|
1242
|
+
label: Members
|
|
1243
|
+
label_singular: Member
|
|
1244
|
+
widget: list
|
|
1245
|
+
root: true # This does the trick
|
|
1246
|
+
fields:
|
|
1247
|
+
- name: name
|
|
1248
|
+
label: Name
|
|
1249
|
+
- name: github
|
|
1250
|
+
label: GitHub account
|
|
1251
|
+
```
|
|
1252
|
+
|
|
1253
|
+
Note: The `root` option is ignored if the file or singleton contains multiple fields. You can still have subfields under the List field.
|
|
1208
1254
|
|
|
1209
1255
|
### Changing the input type of a DateTime field
|
|
1210
1256
|
|
|
1211
1257
|
It may be worth mentioning this topic here because the current [Decap CMS doc about the DateTime widget](https://decapcms.org/docs/widgets/#datetime) is unclear. By default, a DateTime field lets users pick both [date and time](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/datetime-local), but developers can change the input type if needed.
|
|
1212
1258
|
|
|
1213
|
-
|
|
1259
|
+
Set `time_format` to `false` to hide the time picker and make the input [date only](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/date):
|
|
1214
1260
|
|
|
1215
1261
|
```yaml
|
|
1216
1262
|
- label: Start Date
|
|
@@ -1219,7 +1265,7 @@ Use `time_format: false` to hide the time picker and make the input [date only](
|
|
|
1219
1265
|
time_format: false
|
|
1220
1266
|
```
|
|
1221
1267
|
|
|
1222
|
-
|
|
1268
|
+
Set `date_format` to `false` to hide the date picker and make the input [time only](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/time):
|
|
1223
1269
|
|
|
1224
1270
|
```yaml
|
|
1225
1271
|
- label: Start Time
|
|
@@ -1228,7 +1274,7 @@ Use `date_format: false` to hide the date picker and make the input [time only](
|
|
|
1228
1274
|
date_format: false
|
|
1229
1275
|
```
|
|
1230
1276
|
|
|
1231
|
-
We understand that this configuration may be a bit confusing, but it’s necessary to maintain backward compatibility with Netlify CMS. We plan to
|
|
1277
|
+
We understand that this configuration may be a bit confusing, but it’s necessary to maintain backward compatibility with Netlify CMS. We plan to add the `type` option to the DateTime widget and introduce new input types: year, [month](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/month) and [week](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/week).
|
|
1232
1278
|
|
|
1233
1279
|
### Rendering soft line breaks as hard line breaks in Markdown
|
|
1234
1280
|
|
|
@@ -1472,7 +1518,7 @@ Due early 2026
|
|
|
1472
1518
|
|
|
1473
1519
|
### Future
|
|
1474
1520
|
|
|
1475
|
-
- Tackling many of the remaining Netlify/Decap CMS issues, including MDX support,[^122] [manual entry sorting](https://github.com/sveltia/sveltia-cms/issues/214),[^125] config editor,[^10] offline support,[^238] and other [top-voted features](https://github.com/decaporg/decap-cms/issues?q=is%3Aissue+is%3Aopen+sort%3Areactions-%2B1-desc) (some of them may be included in v2.0)
|
|
1521
|
+
- Tackling many of the remaining Netlify/Decap CMS issues, including MDX support,[^122] [manual entry sorting](https://github.com/sveltia/sveltia-cms/issues/214),[^125] [config editor](https://github.com/sveltia/sveltia-cms/discussions/452),[^10] offline support,[^238] and other [top-voted features](https://github.com/decaporg/decap-cms/issues?q=is%3Aissue+is%3Aopen+sort%3Areactions-%2B1-desc) (some of them may be included in v2.0)
|
|
1476
1522
|
- **Sveltia CMS Additions**: edge functions providing features that require server-side implementation, including user management (Netlify Identity alternative), roles,[^23] commits without a Git service account (Git Gateway alternative), API key management, post locking (like [WordPress](https://codex.wordpress.org/Post_Locking))[^166] and scheduled posts[^167]
|
|
1477
1523
|
- More integration options: stock photos, stock videos, cloud storage providers, translation services, maps, analytics tools, etc.
|
|
1478
1524
|
- AI integrations for image generation, content writing, translation, etc.
|
|
@@ -1485,7 +1531,6 @@ Due early 2026
|
|
|
1485
1531
|
|
|
1486
1532
|
## Trivia
|
|
1487
1533
|
|
|
1488
|
-
- As mentioned in the [Motivation](#motivation) section, Sveltia CMS is a complete rewrite of Netlify CMS. We rarely look at the predecessor’s code and don’t use any of it. This is why Sveltia CMS is free of their bugs.
|
|
1489
1534
|
- The [original version of Netlify CMS](https://github.com/netlify/netlify-cms-legacy) was built with Ember before being rewritten in React. And now we are completely rewriting it in Svelte. So this is effectively the second time the application has gone through a framework migration.
|
|
1490
1535
|
- Our [local repository workflow](#working-with-a-local-git-repository) shares implementation with the Test backend, as both utilize the [File System API](https://developer.mozilla.org/en-US/docs/Web/API/File_System_API), allowing us to reduce maintenance costs. The seamless local workflow is critical not only for improved DX, but also for our rapid application development.
|
|
1491
1536
|
|
|
@@ -1646,7 +1691,7 @@ This software is provided “as is” without any express or implied warranty. W
|
|
|
1646
1691
|
|
|
1647
1692
|
[^72]: Netlify/Decap CMS [#7047](https://github.com/decaporg/decap-cms/issues/7047)
|
|
1648
1693
|
|
|
1649
|
-
[^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)
|
|
1694
|
+
[^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)
|
|
1650
1695
|
|
|
1651
1696
|
[^74]: Netlify/Decap CMS [#4209](https://github.com/decaporg/decap-cms/issues/4209)
|
|
1652
1697
|
|