@sveltia/cms 0.24.2 → 0.25.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 +65 -15
- package/dist/sveltia-cms.js +101 -101
- package/dist/sveltia-cms.mjs +114 -114
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
Sveltia CMS is a Git-based lightweight headless CMS under active development as a modern, quick replacement for Netlify CMS and [Decap CMS](https://decapcms.org/). In some simple cases, migration is as easy as a single line of code change, although we are 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
|
-
<br>
|
|
6
6
|
|
|
7
|
-
<br>
|
|
8
8
|
|
|
9
|
-
<br>
|
|
10
10
|
|
|
11
|
-
<br>
|
|
12
12
|
|
|
13
|
-
<br>
|
|
14
14
|
|
|
15
15
|
## Motivation
|
|
16
16
|
|
|
@@ -27,7 +27,7 @@ Our goal is to make it a viable successor to Netlify CMS, expand the Git-based h
|
|
|
27
27
|
While we are fixing reported bugs as fast as we can, usually within 24 hours, the overall progress may be slower than you think. The thing is, it’s not just a personal project of [@kyoshino](https://github.com/kyoshino), but also involves different kinds of activities:
|
|
28
28
|
|
|
29
29
|
- Ensuring maximum compatibility with existing versions of Netlify/Decap CMS
|
|
30
|
-
- Tackling as many [issues reported to Netlify/Decap CMS](https://github.com/decaporg/decap-cms/issues) as possible (so far
|
|
30
|
+
- Tackling as many [issues reported to Netlify/Decap CMS](https://github.com/decaporg/decap-cms/issues) as possible (so far 75+ of them have been effectively solved in Sveltia CMS, with the goal of reaching 100 by GA)
|
|
31
31
|
- Implementing our own enhancement ideas
|
|
32
32
|
|
|
33
33
|
At this point, **we are aiming to ship version 1.0 in Q3 2024**. Check our [release notes](https://github.com/sveltia/sveltia-cms/releases) for updates.
|
|
@@ -47,13 +47,14 @@ We are working hard to create a **significantly better alternative to Netlify CM
|
|
|
47
47
|
- Created and maintained by an [experienced UX engineer](https://github.com/kyoshino) who loves code, design and marketing. You can expect constant UX improvements across the platform.
|
|
48
48
|
- Offers a modern, intuitive user interface, including an immersive dark mode[^2], inspired in part by the Netlify CMS v3 prototype[^1].
|
|
49
49
|
- Comes with touch device support. While the UI is not yet optimized for small screens, large tablets like iPad Pro or Pixel Tablet should work well. Mobile support is planned after the 1.0 release.
|
|
50
|
-
- Made with Svelte, not React, means we can spend more time on UX rather than tedious state management. It also allows us to avoid fatal
|
|
50
|
+
- Made with Svelte, not React, means we can spend more time on UX rather than tedious state management. It also allows us to avoid fatal React app crashes[^100]. Best of all, Svelte offers great performance!
|
|
51
51
|
- The screenshots above are worth a thousand words, but read on to learn about many other improvements in detail.
|
|
52
52
|
|
|
53
53
|
### Better performance
|
|
54
54
|
|
|
55
55
|
- Built completely from scratch with Svelte instead of forking React-based Netlify/Decap CMS. The app starts fast and stays fast. The compiled code is vanilla JavaScript — you can use it with almost any framework.
|
|
56
56
|
- Small footprint: The bundle size is less than 500 KB when minified and gzipped, which is much lighter than bloated Netlify CMS (1.5 MB) and Decap CMS (1.8 MB)[^57][^64]. Sveltia CMS is free of technical debt and [virtual DOM overhead](https://svelte.dev/blog/virtual-dom-is-pure-overhead).
|
|
57
|
+
- No typing lag on input widgets, especially within nested lists and objects[^77].
|
|
57
58
|
- Uses the GraphQL API for GitHub and GitLab to quickly fetch content at once, so that entries and assets can be listed and searched instantly[^32][^65]. It also avoids the slowness and potential API rate limit violations caused by hundreds of requests with Relation widgets[^14].
|
|
58
59
|
- Saving entries and assets to GitHub is also much faster thanks to the [GraphQL mutation](https://github.blog/changelog/2021-09-13-a-simpler-api-for-authoring-commits/).
|
|
59
60
|
- Using caching and lazy loading techniques. A list of repository files is stored locally for faster startup and bandwidth savings.
|
|
@@ -64,12 +65,11 @@ We are working hard to create a **significantly better alternative to Netlify CM
|
|
|
64
65
|
|
|
65
66
|
- You can [work with a local Git repository](#working-with-a-local-git-repository) without any configuration or proxy server[^26].
|
|
66
67
|
- In addition to a streamlined workflow, it offers great performance by loading files natively through the browser rather than using a slow, ad hoc REST API.
|
|
67
|
-
- It also
|
|
68
|
-
- The `logo_url` defined in the configuration will be used[^49].
|
|
68
|
+
- It also avoids a number of issues, including the 30 MB file size limit[^51], an unknown error with `publish_mode`[^75], and an unused `logo_url`[^49].
|
|
69
69
|
- Eliminates some workflow disruptions in the Content Editor:
|
|
70
70
|
- Click once (the Save button) instead of twice (Publish > Publish now) to save an entry.
|
|
71
71
|
- The editor closes automatically when an entry is saved.
|
|
72
|
-
- You can upload multiple assets at once.
|
|
72
|
+
- You can upload multiple assets at once[^5].
|
|
73
73
|
- You can delete multiple entries and assets at once.
|
|
74
74
|
- Some keyboard shortcuts are available for faster editing. More to come!
|
|
75
75
|
- View the Content Library: `Alt+1`
|
|
@@ -117,6 +117,7 @@ We are working hard to create a **significantly better alternative to Netlify CM
|
|
|
117
117
|
- Boolean fields are updated in real time between locales like other widgets to avoid confusion[^35].
|
|
118
118
|
- Solves problems with Chinese, Japanese and Korean (CJK) [IME](https://en.wikipedia.org/wiki/Input_method) text input in the rich text editor for the Markdown widget[^54].
|
|
119
119
|
- You can use the `{{locale}}` template tag in the [`preview_path`](https://decapcms.org/docs/configuration-options/#preview_path) collection option to provide site preview links for each language[^63].
|
|
120
|
+
- You can [localize entry slugs](#localizing-entry-slugs) while linking the localized files[^80], thanks to the support for Hugo’s `translationKey`[^81].
|
|
120
121
|
|
|
121
122
|
### Better collections
|
|
122
123
|
|
|
@@ -127,6 +128,7 @@ We are working hard to create a **significantly better alternative to Netlify CM
|
|
|
127
128
|
- You can set the maximum number of characters for an entry slug with the new `slug_length` collection option[^25].
|
|
128
129
|
- Single quotes in a slug will be replaced with `sanitize_replacement` (default: hyphen) rather than being removed[^52].
|
|
129
130
|
- You can use nested fields (dot notation) in the `path` option for a folder collection, e.g. `{{fields.state.name}}/{{slug}}`[^62].
|
|
131
|
+
- You can use Markdown in collection descriptions[^79]. Bold, italic, strikethrough, code and links are allowed.
|
|
130
132
|
|
|
131
133
|
### Better content editing
|
|
132
134
|
|
|
@@ -149,19 +151,22 @@ We are working hard to create a **significantly better alternative to Netlify CM
|
|
|
149
151
|
- Boolean
|
|
150
152
|
- A required Boolean field with no default value is saved as `false` by default, without raising a confusing validation error[^45].
|
|
151
153
|
- An optional Boolean field with no default value is also saved as `false` by default, rather than nothing[^46].
|
|
154
|
+
- Hidden
|
|
155
|
+
- The `default` value is saved when you create a file collection item, not just a folder collection item[^78].
|
|
152
156
|
- List
|
|
153
157
|
- A required List field with no subfield or value is marked as invalid[^43].
|
|
154
158
|
- An optional List field with no subfield or value is saved as an empty array, rather than nothing[^44].
|
|
155
159
|
- You can enter spaces in a simple text-based List field[^50].
|
|
156
160
|
- You can preview variable types without having to register a preview template[^42].
|
|
157
161
|
- Markdown
|
|
158
|
-
- The rich text editor is built with [Lexical](https://github.com/facebook/lexical) instead of [Slate](https://github.com/ianstormtaylor/slate), which solves
|
|
162
|
+
- The rich text editor is built with [Lexical](https://github.com/facebook/lexical) instead of [Slate](https://github.com/ianstormtaylor/slate), which solves various problems found in Netlify/Decap CMS, including fatal application crashes[^53][^70][^71][^72][^73].
|
|
159
163
|
- You can set the default editor mode by changing the order of the `modes` option[^58]. If you want to use the plain text editor by default, add `modes: [raw, rich_text]` to the field configuration.
|
|
160
164
|
- Object
|
|
161
165
|
- Supports [variable types](https://decapcms.org/docs/variable-type-widgets/) just like the List widget. This allows you to have dependent fields in a collection[^30].
|
|
162
166
|
- An optional Object field can be manually added or removed. If unadded or removed, the required subfields won’t trigger validation errors[^16].
|
|
163
167
|
- Relation
|
|
164
|
-
- Field options are displayed with no additional API requests[^14]. The `options_length`
|
|
168
|
+
- Field options are displayed with no additional API requests[^14]. The confusing `options_length` option, which defaults to 20, is therefore ignored[^76].
|
|
169
|
+
- The redundant `search_fields` option is not required in Sveltia CMS, as it defaults to `display_fields` (and `value_field`).
|
|
165
170
|
- Select
|
|
166
171
|
- It’s possible to select an option with value `0`[^56].
|
|
167
172
|
- String
|
|
@@ -200,7 +205,7 @@ We are working hard to create a **significantly better alternative to Netlify CM
|
|
|
200
205
|
- Navigate between the global media folder and per-collection media folders[^6].
|
|
201
206
|
- Preview image, audio, video, text and PDF files.
|
|
202
207
|
- Check your site’s [CSP](#setting-up-content-security-policy) if the preview doesn’t work.
|
|
203
|
-
- Copy the public URL, file path, text data or image data of a selected asset to clipboard.
|
|
208
|
+
- Copy the public URL[^74], file path, text data or image data of a selected asset to clipboard.
|
|
204
209
|
- The file path starts with `/` as expected[^48].
|
|
205
210
|
- Edit plain text assets, including SVG images.
|
|
206
211
|
- Replace existing assets.
|
|
@@ -209,6 +214,7 @@ We are working hard to create a **significantly better alternative to Netlify CM
|
|
|
209
214
|
- Upload multiple assets at once, including files in nested folders, by browsing or dragging and dropping them into the library[^5].
|
|
210
215
|
- Sort or filter assets by name or file type.
|
|
211
216
|
- View asset details, including size, dimensions, commit author/date and a list of entries that use the selected asset.
|
|
217
|
+
- More features are planned so that you’ll be able to utilize Sveltia CMS as digital asset management (DAM) software.
|
|
212
218
|
- PDF documents are displayed with a thumbnail image in both the Asset Library and the Select File dialog, making it easier to find the file you’re looking for[^38].
|
|
213
219
|
- 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].
|
|
214
220
|
- Hidden files (dot files) don’t appear in the Asset Library[^47].
|
|
@@ -290,7 +296,7 @@ Alternatively, you can probably use one of the [Netlify/Decap CMS templates](htt
|
|
|
290
296
|
|
|
291
297
|
### Migration
|
|
292
298
|
|
|
293
|
-
Have a look at the [compatibility info](#compatibility) above first. If you’re already using Netlify/Decap CMS with the GitHub or GitLab backend and don’t have any custom widget, custom preview or plugin, migrating to Sveltia CMS is super easy — it works as a drop-in replacement. Edit `/admin/index.html` to replace the CMS
|
|
299
|
+
Have a look at the [compatibility info](#compatibility) above first. If you’re already using Netlify/Decap CMS with the GitHub or GitLab backend and don’t have any custom widget, custom preview or plugin, migrating to Sveltia CMS is super easy — it works as a drop-in replacement. Edit `/admin/index.html` to replace the CMS `<script>` tag, and push the change to your repository.
|
|
294
300
|
|
|
295
301
|
From Netlify CMS:
|
|
296
302
|
|
|
@@ -410,6 +416,42 @@ Sveltia CMS comes with a handy DeepL integration so that you can translate any t
|
|
|
410
416
|
1. Open any entry, and you can now translate all fields or individual fields by selecting Translate from the three-dot menu.
|
|
411
417
|
1. If you have upgraded to DeepL API Pro, provide your new Authentication Key in the same way.
|
|
412
418
|
|
|
419
|
+
### Localizing entry slugs
|
|
420
|
+
|
|
421
|
+
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:
|
|
422
|
+
|
|
423
|
+
```yaml
|
|
424
|
+
i18n:
|
|
425
|
+
structure: multiple_folders
|
|
426
|
+
locales: [en, fr]
|
|
427
|
+
|
|
428
|
+
collections:
|
|
429
|
+
- name: posts
|
|
430
|
+
label: Blog posts
|
|
431
|
+
create: true
|
|
432
|
+
folder: data/posts/
|
|
433
|
+
slug: '{{title | localize}}'
|
|
434
|
+
format: yaml
|
|
435
|
+
fields:
|
|
436
|
+
- name: title
|
|
437
|
+
label: Title
|
|
438
|
+
widget: string
|
|
439
|
+
i18n: true
|
|
440
|
+
```
|
|
441
|
+
|
|
442
|
+
With this configuration, an entry is saved with localized filenames, while the default locale’s slug is stored in each file as the extra `translationKey` property, which is used in [Hugo’s multilingual support](https://gohugo.io/content-management/multilingual/#bypassing-default-linking). Even if you’re using a different framework, you can still use this property to link localized files.
|
|
443
|
+
|
|
444
|
+
- `data/posts/en/my-trip-to-new-york.yaml`
|
|
445
|
+
```yaml
|
|
446
|
+
title: My trip to New York
|
|
447
|
+
translationKey: my-trip-to-new-york
|
|
448
|
+
```
|
|
449
|
+
- `data/posts/fr/mon-voyage-a-new-york.yaml`
|
|
450
|
+
```yaml
|
|
451
|
+
title: Mon voyage à New York
|
|
452
|
+
translationKey: my-trip-to-new-york
|
|
453
|
+
```
|
|
454
|
+
|
|
413
455
|
### Disabling non-default locale content
|
|
414
456
|
|
|
415
457
|
You can now disable output of content in selected non-default locales by adding the `save_all_locales` property to the top-level or per-collection `i18n` configuration. Then you’ll find “Disable (locale name)” in the three-dot menu in the top right corner of the content editor. This is useful if the translation isn’t ready yet, but you want to publish the default locale content first.
|
|
@@ -611,7 +653,7 @@ This software is provided “as is” without any express or implied warranty. W
|
|
|
611
653
|
[^9]: Netlify/Decap CMS [#3505](https://github.com/decaporg/decap-cms/issues/3505)
|
|
612
654
|
[^10]: Netlify/Decap CMS [#341](https://github.com/decaporg/decap-cms/issues/341), [#1167](https://github.com/decaporg/decap-cms/issues/1167)
|
|
613
655
|
[^11]: Netlify/Decap CMS [#1382](https://github.com/decaporg/decap-cms/issues/1382)
|
|
614
|
-
[^12]: Netlify/Decap CMS [#1975](https://github.com/decaporg/decap-cms/issues/1975)
|
|
656
|
+
[^12]: Netlify/Decap CMS [#1975](https://github.com/decaporg/decap-cms/issues/1975), [#3712](https://github.com/decaporg/decap-cms/issues/3712)
|
|
615
657
|
[^13]: Netlify/Decap CMS [#5112](https://github.com/decaporg/decap-cms/issues/5112), [#5653](https://github.com/decaporg/decap-cms/issues/5653)
|
|
616
658
|
[^14]: Netlify/Decap CMS [#4635](https://github.com/decaporg/decap-cms/issues/4635), [#5920](https://github.com/decaporg/decap-cms/issues/5920), [#6410](https://github.com/decaporg/decap-cms/issues/6410)
|
|
617
659
|
[^15]: Netlify/Decap CMS [#6932](https://github.com/decaporg/decap-cms/issues/6932)
|
|
@@ -673,4 +715,12 @@ This software is provided “as is” without any express or implied warranty. W
|
|
|
673
715
|
[^71]: Netlify/Decap CMS [#6999](https://github.com/decaporg/decap-cms/issues/6999), [#7152](https://github.com/decaporg/decap-cms/issues/7152)
|
|
674
716
|
[^72]: Netlify/Decap CMS [#7047](https://github.com/decaporg/decap-cms/issues/7047)
|
|
675
717
|
[^73]: Netlify/Decap CMS [#7123](https://github.com/decaporg/decap-cms/issues/7123)
|
|
718
|
+
[^74]: Netlify/Decap CMS [#4209](https://github.com/decaporg/decap-cms/issues/4209)
|
|
719
|
+
[^75]: Netlify/Decap CMS [#5472](https://github.com/decaporg/decap-cms/issues/5472)
|
|
720
|
+
[^76]: Netlify/Decap CMS [#4738](https://github.com/decaporg/decap-cms/issues/4738)
|
|
721
|
+
[^77]: Netlify/Decap CMS [#6565](https://github.com/decaporg/decap-cms/issues/6565)
|
|
722
|
+
[^78]: Netlify/Decap CMS [#3046](https://github.com/decaporg/decap-cms/issues/3046)
|
|
723
|
+
[^79]: Netlify/Decap CMS [#5726](https://github.com/decaporg/decap-cms/issues/5726)
|
|
724
|
+
[^80]: Netlify/Decap CMS [#5493](https://github.com/decaporg/decap-cms/issues/5493), [#6600](https://github.com/decaporg/decap-cms/issues/6600)
|
|
725
|
+
[^81]: Netlify/Decap CMS [#4645](https://github.com/decaporg/decap-cms/issues/4645)
|
|
676
726
|
[^100]: 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), [#6965](https://github.com/decaporg/decap-cms/issues/6965), [#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) — These `removeChild` crashes are common in React apps and seem to be caused by a [browser extension](https://github.com/facebook/react/issues/17256) or [Google Translate](https://github.com/facebook/react/issues/11538).
|