@sveltia/cms 0.8.6 → 0.9.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 +70 -14
- package/dist/sveltia-cms.js +180 -180
- package/package.json +13 -13
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Sveltia CMS
|
|
2
2
|
|
|
3
|
-
Sveltia CMS is a Git-based lightweight headless CMS under active development as a modern, quick replacement for [Netlify/Decap CMS](https://decapcms.org/). In some cases, migration is as easy as a single line of code change, although we’re still working on improving compatibility. The free, open source, UX-focused alternative to Netlify/Decap CMS is now in public beta — with more features to come.
|
|
3
|
+
Sveltia CMS is a Git-based lightweight headless CMS under active development as a modern, quick replacement for [Netlify/Decap CMS](https://decapcms.org/). In some simple cases, migration is as easy as a single line of code change, although we’re still working on improving compatibility. The free, open source, UX-focused alternative to Netlify/Decap CMS is now in public beta — with more features to come.
|
|
4
4
|
|
|
5
5
|
<br>
|
|
6
6
|
|
|
@@ -44,6 +44,7 @@ Here are some highlights mainly compared to Netlify/Decap CMS:
|
|
|
44
44
|
- Uses the GraphQL API for GitHub to quickly fetch content at once, so that entries and assets can be listed and searched instantly. This avoids the slowness and potential API rate limit violations caused by hundreds of requests with relation widgets[^14].
|
|
45
45
|
- Saving entries and assets is also much faster thanks to the [GraphQL mutation](https://github.blog/changelog/2021-09-13-a-simpler-api-for-authoring-commits/).
|
|
46
46
|
- Caches Git files locally to further speed up startup and reduce bandwidth.
|
|
47
|
+
- You can [disable automatic deployments](#disable-automatic-deployments) by default or on demand to save costs and resources associated with CI/CD and to publish multiple changes at once[^24].
|
|
47
48
|
|
|
48
49
|
### Better productivity
|
|
49
50
|
|
|
@@ -72,30 +73,32 @@ Here are some highlights mainly compared to Netlify/Decap CMS:
|
|
|
72
73
|
- Resolves the [limitations in the list and object widgets](https://decapcms.org/docs/beta-features/#i18n-support) so that changes made with these widgets will be duplicated between locales as expected when using the `i18n: duplicate` field configuration[^7].
|
|
73
74
|
- [Entry-relative media folders](https://decapcms.org/docs/beta-features/#folder-collections-media-and-public-folder) can be used in conjunction with the `multiple_folders` i18n structure[^21].
|
|
74
75
|
|
|
75
|
-
###
|
|
76
|
+
### Better collections
|
|
76
77
|
|
|
77
78
|
- You can choose a [custom icon for each collection](#use-a-custom-icon-for-a-collection)[^3].
|
|
78
79
|
- A [per-collection media folder](#use-a-custom-media-folder-for-a-collection) will appear next to the entries.
|
|
79
80
|
- String values in YAML files can be quoted with the new `yaml_quote: true` option for a collection, mainly for framework compatibility[^9].
|
|
80
|
-
-
|
|
81
|
+
- You can set the maximum number of characters for an entry slug with the new `slug_length` collection option[^25].
|
|
81
82
|
|
|
82
|
-
###
|
|
83
|
+
### Better fields/widgets
|
|
83
84
|
|
|
85
|
+
- Relation field options are displayed with no performance overhead[^14]. The `options_length` property is therefore ignored.
|
|
84
86
|
- Required fields, not optional fields, are clearly marked for efficient data entry.
|
|
85
87
|
- Provides a reimagined all-in-one asset selection dialog for file and image fields.
|
|
86
88
|
- [Collection-specific assets](#use-a-custom-media-folder-for-a-collection) will be listed first for easy selection, while all assets can also be displayed in a separate tab[^19].
|
|
87
89
|
- New assets can be uploaded by dragging & dropping them into the dialog[^20].
|
|
88
90
|
- A file/image URL can also be entered in the dialog.
|
|
89
91
|
- Integration with Pexels, Pixabay and Unsplash makes it easy to select and insert free stock photos[^8].
|
|
90
|
-
- Optional object fields (`widget: object` with `required: false`) can be manually added or removed. If removed, the required subfields
|
|
92
|
+
- Optional object fields (`widget: object` with `required: false`) can be manually added or removed. If unadded or removed, the required subfields won’t trigger validation errors[^16].
|
|
91
93
|
- You can revert changes to all fields or a specific field.
|
|
92
94
|
|
|
93
|
-
###
|
|
95
|
+
### Better asset management
|
|
94
96
|
|
|
95
97
|
- A completely new Asset Library, built separately from the image selection dialog, makes it easy to manage all of your files, including images, videos and documents.
|
|
96
|
-
- You can sort or filter assets by name or file type and view asset details, including size, dimensions, and a list of entries that use the selected asset.
|
|
97
|
-
- You can upload multiple assets at once, including files in nested folders, by browsing or dragging & dropping them into the media library[^5].
|
|
98
|
-
- You can navigate between the global media folder and per-collection media folders[^6].
|
|
98
|
+
- You can sort or filter assets by name or file type and view asset details, including size, dimensions, and a list of entries that use the selected asset.
|
|
99
|
+
- You can upload multiple assets at once, including files in nested folders, by browsing or dragging & dropping them into the media library[^5].
|
|
100
|
+
- You can navigate between the global media folder and per-collection media folders[^6].
|
|
101
|
+
- Assets stored in an entry-relative media folder are automatically deleted when the associated entry is deleted because these assets are not available for other entries[^22].
|
|
99
102
|
|
|
100
103
|
## Compatibility
|
|
101
104
|
|
|
@@ -154,6 +157,7 @@ While it’s not our goal to recreate all the features found in Netlify/Decap CM
|
|
|
154
157
|
|
|
155
158
|
### Other features
|
|
156
159
|
|
|
160
|
+
- Netlify Identity Widget is not supported yet.
|
|
157
161
|
- Comprehensive config validation is not implemented yet.
|
|
158
162
|
- Auto-saving a draft entry is not implemented yet.
|
|
159
163
|
- Downloading an asset in the media library is not implemented yet.
|
|
@@ -168,6 +172,7 @@ While it’s not our goal to recreate all the features found in Netlify/Decap CM
|
|
|
168
172
|
- Marketing site
|
|
169
173
|
- Demo site
|
|
170
174
|
- Starter templates
|
|
175
|
+
- Roles[^23]
|
|
171
176
|
- Config editor[^10]
|
|
172
177
|
- Mobile support[^18]
|
|
173
178
|
|
|
@@ -185,7 +190,7 @@ Here are some starter kits for popular frameworks created by community members.
|
|
|
185
190
|
- [Hugo module](https://github.com/privatemaker/headless-cms) by [@privatemaker](https://github.com/privatemaker)
|
|
186
191
|
- [Astro starter template](https://github.com/majesticostudio/astro-sveltia-cms) by [@zanhk](https://github.com/zanhk)
|
|
187
192
|
|
|
188
|
-
Alternatively, you can
|
|
193
|
+
Alternatively, you can probably use one of the [Netlify/Decap CMS templates](https://decapcms.org/docs/start-with-a-template/) and make a quick migration to Sveltia CMS.
|
|
189
194
|
|
|
190
195
|
### Migration
|
|
191
196
|
|
|
@@ -218,7 +223,7 @@ You can use Sveltia CMS with a local Git repository, like the [beta feature](htt
|
|
|
218
223
|
1. Open the dev site at `http://localhost:[port]/` to check the rendered pages.
|
|
219
224
|
1. Commit and push the changes if satisfied, or discard them if you’re just testing.
|
|
220
225
|
|
|
221
|
-
Remember that the local repository support doesn’t do any Git operation. You have to pull, commit and push all changes manually with a Git client. Also, at this point, you have to reload the CMS to see the latest content after
|
|
226
|
+
Remember that the local repository support doesn’t do any Git operation. You have to fetch, pull, commit and push all changes manually with a Git client. Also, at this point, you have to reload the CMS to see the latest content after retrieving remote updates (this will be unnecessary once browsers support the proposed `FileSystemObserver` API).
|
|
222
227
|
|
|
223
228
|
### Use a custom icon for a collection
|
|
224
229
|
|
|
@@ -298,6 +303,43 @@ It’s simple — just specify `{{uuid}}` (full UUID v4), `{{uuid_short}}` (last
|
|
|
298
303
|
+ slug: '{{uuid_short}}'
|
|
299
304
|
```
|
|
300
305
|
|
|
306
|
+
### Disable automatic deployments
|
|
307
|
+
|
|
308
|
+
You may already have a CI/CD tool set up on your Git repository to automatically deploy changes to production. Occasionally, you make a lot of changes to your content to quickly reach the CI/CD provider’s (free) build limits, or you just don’t want to see builds triggered for every single small change.
|
|
309
|
+
|
|
310
|
+
With Sveltia CMS, you can disable automatic deployments by default and manually trigger deployments at your convenience. This is done by adding the `[skip ci]` prefix to commit messages, the convention supported by [GitHub](https://docs.github.com/en/actions/managing-workflow-runs/skipping-workflow-runs), [GitLab](https://docs.gitlab.com/ee/ci/pipelines/#skip-a-pipeline), [CircleCI](https://circleci.com/docs/skip-build/#skip-jobs), [Travis CI](https://docs.travis-ci.com/user/customizing-the-build/#skipping-a-build), [Netlify](https://docs.netlify.com/site-deploys/manage-deploys/#skip-a-deploy), [Cloudflare Pages](https://developers.cloudflare.com/pages/platform/branch-build-controls/#skip-builds) and others. Here are the steps to use it:
|
|
311
|
+
|
|
312
|
+
1. Add the new `automatic_deployments` property to your `backend` configuration with a value of `false`:
|
|
313
|
+
```diff
|
|
314
|
+
backend:
|
|
315
|
+
name: github
|
|
316
|
+
repo: owner/repo
|
|
317
|
+
branch: main
|
|
318
|
+
+ automatic_deployments: false
|
|
319
|
+
```
|
|
320
|
+
1. Commit and deploy the change to the config file and reload the CMS.
|
|
321
|
+
1. Now, whenever you save an entry or asset, `[skip ci]` is automatically added to each commit message. However, deletions are always committed without the prefix to avoid unexpected data retention on your site.
|
|
322
|
+
1. If you want to deploy a new/updated entry, as well as any other unpublished entries and assets, click the arrow next to the Save button in the content editor, then select **Save and Publish**. This will trigger CI/CD by omitting `[skip ci]`.
|
|
323
|
+
|
|
324
|
+
If you set `automatic_deployments` to `true`, the behaviour is reversed. CI/CD will be triggered by default, while you have an option to **Save without Publishing** that adds `[skip ci]` only to the associated commit.
|
|
325
|
+
|
|
326
|
+
Either way, you can manually trigger a deployment by selecting **Publish Changes** under the Account button in the top right corner of the CMS. To use this feature:
|
|
327
|
+
|
|
328
|
+
- GitHub Actions:
|
|
329
|
+
- Publish Changes will [trigger a `repository_dispatch` event](https://docs.github.com/en/rest/repos/repos#create-a-repository-dispatch-event) with the `sveltia-cms-publish` event type. Update your build workflow to receive this event:
|
|
330
|
+
```diff
|
|
331
|
+
on:
|
|
332
|
+
push:
|
|
333
|
+
branches: [$default-branch]
|
|
334
|
+
+ repository_dispatch:
|
|
335
|
+
+ types: [sveltia-cms-publish]
|
|
336
|
+
```
|
|
337
|
+
- Other CI/CD providers:
|
|
338
|
+
1. Select Settings under the Account button in the top right corner of the CMS.
|
|
339
|
+
1. Select the Advanced tab.
|
|
340
|
+
1. Enter the deploy hook URL for your provider, e.g. [Netlify](https://docs.netlify.com/configure-builds/build-hooks/) or [Cloudflare Pages](https://developers.cloudflare.com/pages/platform/deploy-hooks/).
|
|
341
|
+
1. Configure the CSP if necessary. See below.
|
|
342
|
+
|
|
301
343
|
### Set up Content Security Policy
|
|
302
344
|
|
|
303
345
|
If your site adopts Content Security Policy (CSP), use the following policy for Sveltia CMS, or some features may not work.
|
|
@@ -341,6 +383,17 @@ And combine the following policies depending on your Git backend and enabled int
|
|
|
341
383
|
connect-src https://api.deepl.com;
|
|
342
384
|
```
|
|
343
385
|
|
|
386
|
+
If you choose to [disable automatic deployments](#disable-automatic-deployments) and have configured a webhook URL, you may need to add the origin to the `connect-src` directive. For example,
|
|
387
|
+
|
|
388
|
+
- Netlify:
|
|
389
|
+
```csp
|
|
390
|
+
connect-src https://api.netlify.com;
|
|
391
|
+
```
|
|
392
|
+
- Cloudflare Pages
|
|
393
|
+
```csp
|
|
394
|
+
connect-src https://api.cloudflare.com;
|
|
395
|
+
```
|
|
396
|
+
|
|
344
397
|
If you have image field(s) and expect that images will be inserted as URLs, you may want to allow any source using a wildcard instead of specifying individual origins:
|
|
345
398
|
|
|
346
399
|
```csp
|
|
@@ -385,10 +438,10 @@ This software is provided “as is” without any express or implied warranty. W
|
|
|
385
438
|
[^8]: [Netlify/Decap CMS #2579](https://github.com/decaporg/decap-cms/issues/2579)
|
|
386
439
|
[^9]: [Netlify/Decap CMS #3505](https://github.com/decaporg/decap-cms/issues/3505)
|
|
387
440
|
[^10]: [Netlify/Decap CMS #341](https://github.com/decaporg/decap-cms/issues/341)
|
|
388
|
-
[^11]: [Netlify/Decap CMS #1382](https://github.com/decaporg/decap-cms/issues/1382), [#5596](https://github.com/decaporg/decap-cms/issues/5596), [#5752](https://github.com/decaporg/decap-cms/issues/5752), [#6994](https://github.com/decaporg/decap-cms/issues/6994) and
|
|
441
|
+
[^11]: [Netlify/Decap CMS #1382](https://github.com/decaporg/decap-cms/issues/1382), [#2370](https://github.com/decaporg/decap-cms/issues/2370), [#5596](https://github.com/decaporg/decap-cms/issues/5596), [#5752](https://github.com/decaporg/decap-cms/issues/5752), [#6325](https://github.com/decaporg/decap-cms/issues/6325), [#6994](https://github.com/decaporg/decap-cms/issues/6994) and more. We’ll be updating this list after reviewing their issue list.
|
|
389
442
|
[^12]: [Netlify/Decap CMS #1975](https://github.com/decaporg/decap-cms/issues/1975)
|
|
390
|
-
[^13]: [Netlify/Decap CMS #5112](https://github.com/decaporg/decap-cms/issues/5112)
|
|
391
|
-
[^14]: [Netlify/Decap CMS #4635](https://github.com/decaporg/decap-cms/issues/4635), [
|
|
443
|
+
[^13]: [Netlify/Decap CMS #5112](https://github.com/decaporg/decap-cms/issues/5112), [#5653](https://github.com/decaporg/decap-cms/issues/5653)
|
|
444
|
+
[^14]: [Netlify/Decap CMS #4635](https://github.com/decaporg/decap-cms/issues/4635), [#4738](https://github.com/decaporg/decap-cms/issues/4738), [#5920](https://github.com/decaporg/decap-cms/issues/5920), [#6410](https://github.com/decaporg/decap-cms/issues/6410)
|
|
392
445
|
[^15]: [Netlify/Decap CMS #6932](https://github.com/decaporg/decap-cms/issues/6932)
|
|
393
446
|
[^16]: [Netlify/Decap CMS #2103](https://github.com/decaporg/decap-cms/issues/2103)
|
|
394
447
|
[^17]: [Netlify/Decap CMS #1333](https://github.com/decaporg/decap-cms/issues/1333)
|
|
@@ -397,3 +450,6 @@ This software is provided “as is” without any express or implied warranty. W
|
|
|
397
450
|
[^20]: [Netlify/Decap CMS #4563](https://github.com/decaporg/decap-cms/issues/4563)
|
|
398
451
|
[^21]: [Netlify/Decap CMS #4781](https://github.com/decaporg/decap-cms/issues/4781)
|
|
399
452
|
[^22]: [Netlify/Decap CMS #6642](https://github.com/decaporg/decap-cms/issues/6642)
|
|
453
|
+
[^23]: [Netlify/Decap CMS #2](https://github.com/decaporg/decap-cms/issues/2)
|
|
454
|
+
[^24]: [Netlify/Decap CMS #6831](https://github.com/decaporg/decap-cms/issues/6831)
|
|
455
|
+
[^25]: [Netlify/Decap CMS #6987](https://github.com/decaporg/decap-cms/issues/6987)
|