@sveltia/cms 0.87.2 → 0.87.3
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 +36 -20
- 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 +341 -376
- package/types/public.d.ts +103 -83
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)
|
|
@@ -232,9 +233,9 @@ Note: This lengthy section compares Sveltia CMS with both Netlify CMS and Decap
|
|
|
232
233
|
|
|
233
234
|
### Better configuration
|
|
234
235
|
|
|
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
236
|
- Sveltia CMS supports a [JSON configuration file](#providing-a-json-configuration-file) that can be generated for bulk or complex collections.[^60]
|
|
237
237
|
- Also supports [multiple configuration files](#providing-multiple-configuration-files) to allow developers to modularize the configuration.[^197]
|
|
238
|
+
- 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 IDEs such as VS Code.[^253]
|
|
238
239
|
- 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
240
|
|
|
240
241
|
### Better backend support
|
|
@@ -399,8 +400,6 @@ Sveltia CMS has been built with a multilingual architecture from the very beginn
|
|
|
399
400
|
|
|
400
401
|
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
402
|
|
|
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
403
|
- Boolean
|
|
405
404
|
- A required Boolean field with no default value is saved as `false` by default, without raising a confusing validation error.[^45]
|
|
406
405
|
- An optional Boolean field with no default value is also saved as `false` by default, rather than nothing.[^46]
|
|
@@ -437,7 +436,7 @@ Note: The Date widget has been deprecated in Netlify CMS and removed from both D
|
|
|
437
436
|
- A collapsed List field will not display a programmatic summary like `List [ Map { "key": "value" } ]` if the `summary` option is not set.[^183]
|
|
438
437
|
- Map
|
|
439
438
|
- 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),
|
|
439
|
+
- With the [Geolocation API](https://developer.mozilla.org/en-US/docs/Web/API/Geolocation_API), users can get their current location.
|
|
441
440
|
- The value can be cleared if the field is optional.
|
|
442
441
|
- The map’s zoom level is adjusted more intuitively using pinch gestures.
|
|
443
442
|
- The map looks good in dark mode.
|
|
@@ -568,7 +567,7 @@ Note: The Date widget has been deprecated in Netlify CMS and removed from both D
|
|
|
568
567
|
|
|
569
568
|
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
569
|
|
|
571
|
-
However, 100% feature parity is
|
|
570
|
+
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
571
|
|
|
573
572
|
### Features not to be implemented
|
|
574
573
|
|
|
@@ -599,7 +598,7 @@ However, 100% feature parity is not planned, and some features are still missing
|
|
|
599
598
|
|
|
600
599
|
### Current limitations
|
|
601
600
|
|
|
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
|
|
601
|
+
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
602
|
|
|
604
603
|
- Comprehensive site config validation
|
|
605
604
|
- [Localization](https://github.com/sveltia/sveltia-cms/blob/main/src/lib/locales/README.md) other than English and Japanese
|
|
@@ -645,7 +644,7 @@ Sveltia CMS provides partial compatibility with [Static CMS](https://github.com/
|
|
|
645
644
|
|
|
646
645
|
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
646
|
|
|
648
|
-
|
|
647
|
+
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
648
|
|
|
650
649
|
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
650
|
|
|
@@ -715,6 +714,10 @@ Next, let’s [test Sveltia CMS on your local machine](#working-with-a-local-git
|
|
|
715
714
|
|
|
716
715
|
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
716
|
|
|
717
|
+
#### Editing the configuration file
|
|
718
|
+
|
|
719
|
+
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 Netlify/Decap CMS schema to your YAML configuration file. To use the Sveltia CMS schema instead, you need to specify its URL.
|
|
720
|
+
|
|
718
721
|
#### Migrating from Git Gateway backend
|
|
719
722
|
|
|
720
723
|
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.
|
|
@@ -747,9 +750,9 @@ You can host your Sveltia CMS-managed site anywhere, such as [Cloudflare Pages](
|
|
|
747
750
|
|
|
748
751
|
### Enabling autocomplete and validation for the configuration file
|
|
749
752
|
|
|
750
|
-
Sveltia CMS provides
|
|
753
|
+
Sveltia CMS provides a [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
754
|
|
|
752
|
-
If you use
|
|
755
|
+
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
756
|
|
|
754
757
|
```json
|
|
755
758
|
{
|
|
@@ -759,7 +762,22 @@ If you use [Visual Studio Code](https://code.visualstudio.com/), you can enable
|
|
|
759
762
|
}
|
|
760
763
|
```
|
|
761
764
|
|
|
762
|
-
|
|
765
|
+
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:
|
|
766
|
+
|
|
767
|
+
```json
|
|
768
|
+
{
|
|
769
|
+
"json.schemas": [
|
|
770
|
+
{
|
|
771
|
+
"fileMatch": ["/static/admin/config.json"],
|
|
772
|
+
"url": "https://unpkg.com/@sveltia/cms/schema/sveltia-cms.json"
|
|
773
|
+
}
|
|
774
|
+
]
|
|
775
|
+
}
|
|
776
|
+
```
|
|
777
|
+
|
|
778
|
+
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.
|
|
779
|
+
|
|
780
|
+
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
781
|
|
|
764
782
|
### Providing a JSON configuration file
|
|
765
783
|
|
|
@@ -849,19 +867,19 @@ fields:
|
|
|
849
867
|
|
|
850
868
|
### Adding dividers to the collection list
|
|
851
869
|
|
|
852
|
-
Sveltia CMS
|
|
870
|
+
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
871
|
|
|
854
872
|
```yaml
|
|
855
873
|
collections:
|
|
856
874
|
- name: products
|
|
857
875
|
...
|
|
858
876
|
- divider: true
|
|
859
|
-
name: d1 # d2, d3, etc. Should be unique for each divider
|
|
860
|
-
files: []
|
|
861
877
|
- name: pages
|
|
862
878
|
...
|
|
863
879
|
```
|
|
864
880
|
|
|
881
|
+
The [singleton collection](#using-singletons) also supports dividers.
|
|
882
|
+
|
|
865
883
|
### Using a custom media folder for a collection
|
|
866
884
|
|
|
867
885
|
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 +951,7 @@ index_file:
|
|
|
933
951
|
preview: false # Hide the preview pane if needed. Default: true
|
|
934
952
|
```
|
|
935
953
|
|
|
936
|
-
If
|
|
954
|
+
If your regular entry fields and index file fields are identical and you don’t need any options, simply write:
|
|
937
955
|
|
|
938
956
|
```yaml
|
|
939
957
|
index_file: true
|
|
@@ -943,7 +961,7 @@ Note that the special index file is placed right under the `folder`, regardless
|
|
|
943
961
|
|
|
944
962
|
### Using singletons
|
|
945
963
|
|
|
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 static data files. Singleton files appear in the content library’s sidebar under the
|
|
964
|
+
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 static 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
965
|
|
|
948
966
|
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:
|
|
949
967
|
|
|
@@ -969,8 +987,7 @@ singletons:
|
|
|
969
987
|
file: content/home.yaml
|
|
970
988
|
icon: home # You can specify an icon
|
|
971
989
|
...
|
|
972
|
-
-
|
|
973
|
-
divider: true # You can also add dividers
|
|
990
|
+
- divider: true # You can also add dividers
|
|
974
991
|
- name: settings
|
|
975
992
|
label: Site Settings
|
|
976
993
|
file: content/settings.yaml
|
|
@@ -1472,7 +1489,7 @@ Due early 2026
|
|
|
1472
1489
|
|
|
1473
1490
|
### Future
|
|
1474
1491
|
|
|
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)
|
|
1492
|
+
- 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
1493
|
- **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
1494
|
- More integration options: stock photos, stock videos, cloud storage providers, translation services, maps, analytics tools, etc.
|
|
1478
1495
|
- AI integrations for image generation, content writing, translation, etc.
|
|
@@ -1485,7 +1502,6 @@ Due early 2026
|
|
|
1485
1502
|
|
|
1486
1503
|
## Trivia
|
|
1487
1504
|
|
|
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
1505
|
- 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
1506
|
- 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
1507
|
|
|
@@ -1646,7 +1662,7 @@ This software is provided “as is” without any express or implied warranty. W
|
|
|
1646
1662
|
|
|
1647
1663
|
[^72]: Netlify/Decap CMS [#7047](https://github.com/decaporg/decap-cms/issues/7047)
|
|
1648
1664
|
|
|
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)
|
|
1665
|
+
[^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
1666
|
|
|
1651
1667
|
[^74]: Netlify/Decap CMS [#4209](https://github.com/decaporg/decap-cms/issues/4209)
|
|
1652
1668
|
|