@sveltia/cms 0.8.5 → 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 +78 -19
- package/dist/sveltia-cms.js +180 -180
- package/package.json +17 -17
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/).
|
|
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
|
|
|
@@ -10,13 +10,13 @@ Sveltia CMS is a Git-based lightweight headless CMS under active development as
|
|
|
10
10
|
|
|
11
11
|
<br>
|
|
12
12
|
|
|
13
|
-
; Sveltia CMS](docs/screenshot-5-20231127.webp)<br>
|
|
14
14
|
|
|
15
15
|
## Motivation
|
|
16
16
|
|
|
17
17
|
Sveltia CMS was born in November 2022, when the progress of Netlify CMS was stalled for more than six months. [@kyoshino](https://github.com/kyoshino)’s clients wanted to replace their Netlify CMS instances without much effort, mainly to get better internationalization (i18n) support.
|
|
18
18
|
|
|
19
|
-
To achieve radical improvements in UX, performance and i18n, it was decided to build an alternative from the ground up, while ensuring an easy migration path from the other. After proving the concept with a rapid [Svelte](https://svelte.dev/) prototype, development was accelerated to address their primary use cases. The new offering has since been released as open source software to encourage wider adoption.
|
|
19
|
+
To achieve radical improvements in UX, performance and i18n, it was decided to build an alternative from the ground up, while ensuring an easy migration path from the other. After proving the concept with a rapid [Svelte](https://svelte.dev/) prototype, development was accelerated to address their primary use cases. The new offering has since been named Sveltia CMS and released as open source software to encourage wider adoption.
|
|
20
20
|
|
|
21
21
|
Our goal is to make it a viable successor to Netlify CMS, expand the Git-based headless CMS market, empower small businesses and individuals who need a simple yet powerful CMS solution, and showcase the huge potential of the Svelte framework.
|
|
22
22
|
|
|
@@ -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
|
|
|
@@ -70,32 +71,34 @@ Here are some highlights mainly compared to Netlify/Decap CMS:
|
|
|
70
71
|
- You can [disable non-default locale content](#disable-non-default-locale-content)[^15].
|
|
71
72
|
- You can [use a random UUID for an entry slug](#use-a-random-id-for-an-entry-slug), which is a good option for locales that write in non-Latin characters[^12].
|
|
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
|
-
- [Entry-relative media folders](https://decapcms.org/docs/beta-features/#folder-collections-media-and-public-folder) can be used in conjunction with the `
|
|
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.
|
|
@@ -163,11 +167,12 @@ While it’s not our goal to recreate all the features found in Netlify/Decap CM
|
|
|
163
167
|
|
|
164
168
|
- [Svelte 5](https://svelte.dev/blog/runes) migration
|
|
165
169
|
- Further Netlify/Decap CMS compatibility, including Editorial Workflow
|
|
166
|
-
-
|
|
170
|
+
- Localization
|
|
167
171
|
- Documentation
|
|
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
|
|
|
@@ -183,6 +188,9 @@ Here are some starter kits for popular frameworks created by community members.
|
|
|
183
188
|
|
|
184
189
|
- [Eleventy starter template](https://github.com/danurbanowicz/eleventy-sveltia-cms-starter) by [@danurbanowicz](https://github.com/danurbanowicz)
|
|
185
190
|
- [Hugo module](https://github.com/privatemaker/headless-cms) by [@privatemaker](https://github.com/privatemaker)
|
|
191
|
+
- [Astro starter template](https://github.com/majesticostudio/astro-sveltia-cms) by [@zanhk](https://github.com/zanhk)
|
|
192
|
+
|
|
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.
|
|
186
194
|
|
|
187
195
|
### Migration
|
|
188
196
|
|
|
@@ -215,7 +223,7 @@ You can use Sveltia CMS with a local Git repository, like the [beta feature](htt
|
|
|
215
223
|
1. Open the dev site at `http://localhost:[port]/` to check the rendered pages.
|
|
216
224
|
1. Commit and push the changes if satisfied, or discard them if you’re just testing.
|
|
217
225
|
|
|
218
|
-
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).
|
|
219
227
|
|
|
220
228
|
### Use a custom icon for a collection
|
|
221
229
|
|
|
@@ -295,6 +303,43 @@ It’s simple — just specify `{{uuid}}` (full UUID v4), `{{uuid_short}}` (last
|
|
|
295
303
|
+ slug: '{{uuid_short}}'
|
|
296
304
|
```
|
|
297
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
|
+
|
|
298
343
|
### Set up Content Security Policy
|
|
299
344
|
|
|
300
345
|
If your site adopts Content Security Policy (CSP), use the following policy for Sveltia CMS, or some features may not work.
|
|
@@ -338,6 +383,17 @@ And combine the following policies depending on your Git backend and enabled int
|
|
|
338
383
|
connect-src https://api.deepl.com;
|
|
339
384
|
```
|
|
340
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
|
+
|
|
341
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:
|
|
342
398
|
|
|
343
399
|
```csp
|
|
@@ -364,13 +420,13 @@ Want to build a website with Sveltia CMS? Maintainer [@kyoshino](https://github.
|
|
|
364
420
|
|
|
365
421
|
Sveltia CMS is still in early beta, so we do expect various problems. Please [report any bugs to us](https://github.com/sveltia/sveltia-cms/issues/new). Feel free to submit feature requests as well. Meanwhile, pull requests may not be accepted for the time being due to limited review resources. As we get closer to the 1.0 release, we’ll be welcoming [localizers](https://github.com/sveltia/sveltia-cms/blob/main/src/lib/locales/README.md).
|
|
366
422
|
|
|
367
|
-
## Related
|
|
423
|
+
## Related links
|
|
368
424
|
|
|
369
425
|
- Introducing Sveltia CMS: a short technical presentation by [@kyoshino](https://github.com/kyoshino) during the _This Week in Svelte_ online meetup on March 31, 2023 — [recording](https://youtu.be/-YjLubiieYs?t=1660) & [slides](https://docs.google.com/presentation/d/1Wi4ty-1AwOp2-zy7LctmzCV4rrdYPfke9NGhO0DdRdM)
|
|
370
426
|
|
|
371
427
|
## Disclaimer
|
|
372
428
|
|
|
373
|
-
This software is provided “as is” without any express or implied warranty. This product is not affiliated with or endorsed by Netlify, Decap CMS or any other integrated services. All product names, logos, and brands are the property of their respective owners.
|
|
429
|
+
This software is provided “as is” without any express or implied warranty. We are not obligated to provide any support for the application. This product is not affiliated with or endorsed by Netlify, Decap CMS or any other integrated services. All product names, logos, and brands are the property of their respective owners.
|
|
374
430
|
|
|
375
431
|
[^1]: [Netlify/Decap CMS #2557](https://github.com/decaporg/decap-cms/issues/2557)
|
|
376
432
|
[^2]: [Netlify/Decap CMS #3267](https://github.com/decaporg/decap-cms/issues/3267)
|
|
@@ -382,10 +438,10 @@ This software is provided “as is” without any express or implied warranty. T
|
|
|
382
438
|
[^8]: [Netlify/Decap CMS #2579](https://github.com/decaporg/decap-cms/issues/2579)
|
|
383
439
|
[^9]: [Netlify/Decap CMS #3505](https://github.com/decaporg/decap-cms/issues/3505)
|
|
384
440
|
[^10]: [Netlify/Decap CMS #341](https://github.com/decaporg/decap-cms/issues/341)
|
|
385
|
-
[^11]: [Netlify/Decap CMS #1382](https://github.com/decaporg/decap-cms/issues/1382), [
|
|
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.
|
|
386
442
|
[^12]: [Netlify/Decap CMS #1975](https://github.com/decaporg/decap-cms/issues/1975)
|
|
387
|
-
[^13]: [Netlify/Decap CMS #5112](https://github.com/decaporg/decap-cms/issues/5112)
|
|
388
|
-
[^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)
|
|
389
445
|
[^15]: [Netlify/Decap CMS #6932](https://github.com/decaporg/decap-cms/issues/6932)
|
|
390
446
|
[^16]: [Netlify/Decap CMS #2103](https://github.com/decaporg/decap-cms/issues/2103)
|
|
391
447
|
[^17]: [Netlify/Decap CMS #1333](https://github.com/decaporg/decap-cms/issues/1333)
|
|
@@ -394,3 +450,6 @@ This software is provided “as is” without any express or implied warranty. T
|
|
|
394
450
|
[^20]: [Netlify/Decap CMS #4563](https://github.com/decaporg/decap-cms/issues/4563)
|
|
395
451
|
[^21]: [Netlify/Decap CMS #4781](https://github.com/decaporg/decap-cms/issues/4781)
|
|
396
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)
|