@sveltia/cms 0.19.10 → 0.21.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 +85 -68
- package/dist/sveltia-cms.js +463 -363
- package/dist/sveltia-cms.mjs +627 -0
- package/package.json +18 -9
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 CMS and [Decap CMS](https://decapcms.org/). In some simple cases, migration is as easy as a single line of code change, although we
|
|
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
5
|
<br>
|
|
6
6
|
|
|
@@ -20,6 +20,18 @@ To achieve radical improvements in UX, performance, i18n and other areas, it was
|
|
|
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
|
|
|
23
|
+
## Development status
|
|
24
|
+
|
|
25
|
+
**Sveltia CMS is still in beta**, so please be careful when trying it out.
|
|
26
|
+
|
|
27
|
+
While we are fixing reported bugs as fast as we can, 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
|
+
|
|
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 75+ of them have been effectively solved in Sveltia CMS, with the goal of reaching 100 by GA)
|
|
31
|
+
- Implementing our own enhancement ideas
|
|
32
|
+
|
|
33
|
+
At this point **we hope to ship version 1.0 in Q3 2024**. Check our [release notes](https://github.com/sveltia/sveltia-cms/releases) for updates!
|
|
34
|
+
|
|
23
35
|
## Features
|
|
24
36
|
|
|
25
37
|
We are working hard to create a **much better alternative to Netlify CMS** and Decap CMS by improving everything. Here’s what makes Sveltia CMS different. Look how serious we are!
|
|
@@ -34,7 +46,7 @@ We are working hard to create a **much better alternative to Netlify CMS** and D
|
|
|
34
46
|
|
|
35
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.
|
|
36
48
|
- Offers a modern, intuitive user interface, including an immersive dark mode[^2], inspired in part by the Netlify CMS v3 prototype[^1].
|
|
37
|
-
- 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.
|
|
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.
|
|
38
50
|
- Made with Svelte, not React, means we can spend more time on UX rather than tedious state management.
|
|
39
51
|
- The screenshots above are worth a thousand words!
|
|
40
52
|
- Read on to learn about many other enhancements, including performance, productivity, accessibility, service integrations, and an all-new Asset Library.
|
|
@@ -42,7 +54,7 @@ We are working hard to create a **much better alternative to Netlify CMS** and D
|
|
|
42
54
|
### Better performance
|
|
43
55
|
|
|
44
56
|
- 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.
|
|
45
|
-
- Small footprint: The bundle size is less than
|
|
57
|
+
- 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]. Sveltia CMS is free of technical debt and [virtual DOM overhead](https://svelte.dev/blog/virtual-dom-is-pure-overhead).
|
|
46
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]. It also avoids the slowness and potential API rate limit violations caused by hundreds of requests with Relation widgets[^14].
|
|
47
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/).
|
|
48
60
|
- A list of repository files is cached locally for faster startup and bandwidth savings.
|
|
@@ -51,12 +63,13 @@ We are working hard to create a **much better alternative to Netlify CMS** and D
|
|
|
51
63
|
|
|
52
64
|
### Better productivity
|
|
53
65
|
|
|
54
|
-
- You can [work with a local Git repository](#
|
|
55
|
-
- In addition to a streamlined workflow, it offers great performance
|
|
66
|
+
- You can [work with a local Git repository](#working-with-a-local-git-repository) without any configuration or proxy server[^26].
|
|
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 API.
|
|
56
68
|
- It also allows you to bypass the 30 MB file size limit[^51].
|
|
57
69
|
- The `logo_url` defined in the configuration will be used[^49].
|
|
58
|
-
-
|
|
59
|
-
-
|
|
70
|
+
- Eliminates some workflow disruptions in the Content Editor:
|
|
71
|
+
- Click once (the Save button) instead of twice (Publish > Publish now) to save an entry.
|
|
72
|
+
- The editor closes automatically when an entry is saved.
|
|
60
73
|
- You can upload multiple assets at once. (See below)
|
|
61
74
|
- You can delete multiple entries and assets at once.
|
|
62
75
|
- Some keyboard shortcuts are available for faster editing. More to come!
|
|
@@ -77,35 +90,39 @@ We are working hard to create a **much better alternative to Netlify CMS** and D
|
|
|
77
90
|
|
|
78
91
|
### Better security
|
|
79
92
|
|
|
80
|
-
- Avoids high/critical severity vulnerabilities through constant dependency updates and frequent releases[^
|
|
81
|
-
- We have documented how to [set up a Content Security Policy](#
|
|
82
|
-
- The `unsafe-eval`
|
|
93
|
+
- Avoids high/critical severity vulnerabilities through constant dependency updates and frequent releases[^33].
|
|
94
|
+
- We have documented how to [set up a Content Security Policy](#setting-up-content-security-policy) for the CMS.
|
|
95
|
+
- The `unsafe-eval` and `unsafe-inline` keywords are not needed in the `script-src` CSP directive[^34].
|
|
83
96
|
- The `same-origin` referrer policy is automatically set with a `<meta>` tag.
|
|
84
97
|
|
|
85
98
|
### Better backend support
|
|
86
99
|
|
|
87
100
|
- Uses the GraphQL API where possible for better performance, as mentioned above. You don’t need to set the `use_graphql` option to enable it for GitHub and GitLab.
|
|
88
101
|
- The Git branch name is automatically set to the repository’s default branch (`main`, `master` or whatever) if not specified in the configuration file, preventing data loading errors due to a hardcoded fallback to `master`[^27].
|
|
89
|
-
- You can [disable automatic deployments](#
|
|
102
|
+
- You can [disable automatic deployments](#disabling-automatic-deployments) by default or on demand to save costs and resources associated with CI/CD and to publish multiple changes at once[^24].
|
|
103
|
+
- The GitLab backend comes with background service status checking, just like GitHub.
|
|
90
104
|
|
|
91
105
|
### Better i18n support
|
|
92
106
|
|
|
93
107
|
- You can easily switch between locales while editing with just a click on a button instead of a dropdown list.
|
|
94
108
|
- Fields in non-default locales are validated as expected[^13].
|
|
95
109
|
- Boolean, DateTime, List and Number fields in the entry preview are displayed in a localized format.
|
|
96
|
-
- [Integrates DeepL](#
|
|
97
|
-
- You can [disable non-default locale content](#
|
|
98
|
-
- You can [use a random UUID for an entry slug](#
|
|
99
|
-
-
|
|
110
|
+
- [Integrates DeepL](#using-deepl-to-translate-entry-fields) to allow translation of text fields from another locale with one click.
|
|
111
|
+
- You can [disable non-default locale content](#disabling-non-default-locale-content)[^15].
|
|
112
|
+
- You can [use a random UUID for an entry slug](#using-a-random-id-for-an-entry-slug), which is a good option for locales that write in non-Latin characters.
|
|
113
|
+
- Removes the [limitations in the List and Object widgets](https://decapcms.org/docs/i18n/#limitations) so that changes made with these widgets will be duplicated between locales as expected when using the `i18n: duplicate` field configuration[^7].
|
|
114
|
+
- Raises a validation error instead of an internal error if the `single_file` structure is used and a required field is not filled in any of the locales[^55].
|
|
100
115
|
- [Entry-relative media folders](https://decapcms.org/docs/collection-folder/#media-and-public-folder) can be used in conjunction with the `multiple_folders` i18n structure[^21].
|
|
101
116
|
- Boolean fields are updated in real time between locales like other widgets to avoid confusion[^35].
|
|
117
|
+
- 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].
|
|
102
118
|
|
|
103
119
|
### Better collections
|
|
104
120
|
|
|
105
|
-
- You can choose a [custom icon for each collection](#
|
|
106
|
-
- Assets stored in a [per-collection media folder](#
|
|
121
|
+
- You can choose a [custom icon for each collection](#using-a-custom-icon-for-a-collection)[^3].
|
|
122
|
+
- Assets stored in a [per-collection media folder](#using-a-custom-media-folder-for-a-collection) can be displayed next to the entries.
|
|
107
123
|
- Entry slug template tags support [filter transformations](https://decapcms.org/docs/summary-strings/) just like summary string template tags[^29].
|
|
108
124
|
- You can set the maximum number of characters for an entry slug with the new `slug_length` collection option[^25].
|
|
125
|
+
- Single quotes in a slug will be replaced with `sanitize_replacement` (default: hyphen) rather than being removed[^52].
|
|
109
126
|
|
|
110
127
|
### Better content editing
|
|
111
128
|
|
|
@@ -137,23 +154,27 @@ We are working hard to create a **much better alternative to Netlify CMS** and D
|
|
|
137
154
|
- An optional Object field can be manually added or removed. If unadded or removed, the required subfields won’t trigger validation errors[^16].
|
|
138
155
|
- Relation
|
|
139
156
|
- Field options are displayed with no additional API requests[^14]. The `options_length` property is therefore ignored.
|
|
157
|
+
- Select
|
|
158
|
+
- It’s possible to select an option with value `0`[^56].
|
|
140
159
|
- String
|
|
141
160
|
- Supports the `type` property that accepts `url` or `email` as a value, which will validate the value as a URL or email.
|
|
142
161
|
- Supports the `prefix` and `suffix` string properties, which automatically prepend and/or append the developer-defined value to the user-input value.
|
|
162
|
+
- Markdown
|
|
163
|
+
- The rich text editor is built with [Lexical](https://github.com/facebook/lexical) instead of [Slate](https://github.com/ianstormtaylor/slate), which solves several problems found in Netlify/Decap CMS, including fatal application crashes[^53].
|
|
143
164
|
- Boolean, Number and String
|
|
144
165
|
- Supports the `before_input` and `after_input` string properties, which allow developers to display custom labels before and/or after the input UI[^28]. Markdown is supported in the value.
|
|
145
166
|
- List and Object
|
|
146
167
|
- The `summary` is displayed correctly when it refers to a Relation field[^36].
|
|
147
168
|
- File and Image
|
|
148
169
|
- Provides a reimagined all-in-one asset selection dialog for File and Image fields.
|
|
149
|
-
- [Collection-specific assets](#
|
|
170
|
+
- [Collection-specific assets](#using-a-custom-media-folder-for-a-collection) are listed for easy selection, while all assets are displayed in a separate tab[^19].
|
|
150
171
|
- A new asset can be uploaded by dragging & dropping it into the dialog[^20].
|
|
151
172
|
- A URL can also be entered in the dialog.
|
|
152
|
-
- Integration with Pexels, Pixabay and Unsplash makes it easy to select and insert a free stock photo[^8].
|
|
173
|
+
- Integration with Pexels, Pixabay and Unsplash makes it easy to select and insert a free stock photo[^8]. More services will be added later.
|
|
153
174
|
- String, Text and Markdown
|
|
154
175
|
- A required field containing only spaces or line breaks will result in a validation error, as if no characters were entered.
|
|
155
176
|
- New widgets
|
|
156
|
-
- In addition to [generating UUIDs for entry slugs](#
|
|
177
|
+
- In addition to [generating UUIDs for entry slugs](#using-a-random-id-for-an-entry-slug), Sveltia CMS also supports the proposed `uuid` widget with the following properties[^12]:
|
|
157
178
|
- `prefix`: A string to be prepended to the value. Default: an empty string.
|
|
158
179
|
- `use_b32_encoding`: Whether to encode the value with Base32. Default: `false`.
|
|
159
180
|
- `read_only`: Whether to make the field read-only. Default: `true`.
|
|
@@ -164,10 +185,10 @@ We are working hard to create a **much better alternative to Netlify CMS** and D
|
|
|
164
185
|
- 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.
|
|
165
186
|
- Navigate between the global media folder and per-collection media folders[^6].
|
|
166
187
|
- Preview image, audio, video, text and PDF files.
|
|
167
|
-
- Check your site’s [CSP](#
|
|
188
|
+
- Check your site’s [CSP](#setting-up-content-security-policy) if the preview doesn’t work.
|
|
168
189
|
- Copy the public URL, file path, text data or image data of a selected asset to clipboard.
|
|
169
190
|
- The file path starts with `/` as expected[^48].
|
|
170
|
-
- Edit
|
|
191
|
+
- Edit plain text assets, including SVG images.
|
|
171
192
|
- Replace existing assets.
|
|
172
193
|
- Download one or more selected assets at once.
|
|
173
194
|
- Delete one or more selected assets at once.
|
|
@@ -180,35 +201,29 @@ We are working hard to create a **much better alternative to Netlify CMS** and D
|
|
|
180
201
|
|
|
181
202
|
## Compatibility
|
|
182
203
|
|
|
183
|
-
|
|
204
|
+
We are trying to make Sveltia CMS as compatible as possible with Netlify/Decap CMS before the 1.0 release, so that more users can seamlessly switch to our modern, powerful alternative. However, some features will be omitted due to performance and other factors. The table below shows the current limitations of Sveltia CMS:
|
|
184
205
|
|
|
185
206
|
| Feature | Status in Sveltia CMS |
|
|
186
207
|
| --- | --- |
|
|
187
|
-
|
|
|
188
|
-
|
|
|
189
|
-
|
|
|
190
|
-
|
|
|
191
|
-
|
|
|
192
|
-
| Collections | Nested collections are not supported
|
|
193
|
-
| Widgets | Custom widgets are not supported
|
|
194
|
-
| Customizations | Custom previews, custom formatters
|
|
208
|
+
| Backends | Only the GitHub and GitLab backends are available. We’ll add the Test backend for our demo site, but Azure, Bitbucket and Gitea are unlikely to be supported due to performance limitations. Netlify Git Gateway will not be supported for the same reason; we may implement a performant alternative sometime later. |
|
|
209
|
+
| Configuration | UI Locales are currently only available in English and Japanese. Comprehensive config validation is not yet implemented. |
|
|
210
|
+
| Media Libraries | We will add support for Cloudinary and Uploadcare soon. Deprecated Netlify Large Media will not be supported. |
|
|
211
|
+
| Workflow | Editorial Workflow and Open Authoring are not yet supported. |
|
|
212
|
+
| Content Editor | Auto-saving a draft entry is not yet implemented. |
|
|
213
|
+
| Collections | Nested collections are not yet supported. |
|
|
214
|
+
| Widgets | Custom widgets are not yet supported. [See below](#widget-limitations) for other limitations. |
|
|
215
|
+
| Customizations | Custom previews, custom formatters and event subscriptions are not yet supported. |
|
|
195
216
|
|
|
196
217
|
### Widget limitations
|
|
197
218
|
|
|
198
219
|
| Widget | Status in Sveltia CMS |
|
|
199
220
|
| --- | --- |
|
|
200
|
-
| Code | Not supported
|
|
221
|
+
| Code | Not yet supported. |
|
|
201
222
|
| Date | Sveltia CMS has dropped the support for the deprecated widget following Decap CMS 3.0. Use the DateTime widget instead. |
|
|
202
|
-
| DateTime | The `date_format` and `time_format` options with Moment.js tokens are not supported
|
|
203
|
-
| File/Image | Field-specific media folders and media library options are not supported
|
|
204
|
-
| Map | Not supported
|
|
205
|
-
| Markdown |
|
|
206
|
-
|
|
207
|
-
### Other features
|
|
208
|
-
|
|
209
|
-
- Comprehensive config validation is not implemented yet.
|
|
210
|
-
- Auto-saving a draft entry is not implemented yet.
|
|
211
|
-
- [Backend health check](https://www.githubstatus.com/api) is not implemented yet.
|
|
223
|
+
| DateTime | The `date_format` and `time_format` options with Moment.js tokens are not yet supported. Note: Decap CMS 3.1 has replaced Moment.js with [Day.js](https://day.js.org/); we’ll follow the change soon. |
|
|
224
|
+
| File/Image | Field-specific media folders and media library options are not yet supported other than `media_library.config.max_file_size` for the default media library. |
|
|
225
|
+
| Map | Not yet supported. |
|
|
226
|
+
| Markdown | Editor components are not yet supported. Remark plugins will not be supported as they are not compatible with our Lexical-based rich text editor. |
|
|
212
227
|
|
|
213
228
|
## Roadmap
|
|
214
229
|
|
|
@@ -254,27 +269,33 @@ From Netlify CMS:
|
|
|
254
269
|
|
|
255
270
|
```diff
|
|
256
271
|
-<script src="https://unpkg.com/netlify-cms@^2.0.0/dist/netlify-cms.js"></script>
|
|
257
|
-
+<script src="https://unpkg.com/@sveltia/cms/dist/sveltia-cms.js"
|
|
272
|
+
+<script src="https://unpkg.com/@sveltia/cms/dist/sveltia-cms.js"></script>
|
|
258
273
|
```
|
|
259
274
|
|
|
260
275
|
From Decap CMS:
|
|
261
276
|
|
|
262
277
|
```diff
|
|
263
278
|
-<script src="https://unpkg.com/decap-cms@^3.0.0/dist/decap-cms.js"></script>
|
|
264
|
-
+<script src="https://unpkg.com/@sveltia/cms/dist/sveltia-cms.js"
|
|
279
|
+
+<script src="https://unpkg.com/@sveltia/cms/dist/sveltia-cms.js"></script>
|
|
265
280
|
```
|
|
266
281
|
|
|
267
282
|
That’s it! You can open `https://[hostname]/admin/` as before to start editing. There is even no authentication process if you’ve already been signed in with GitHub or GitLab on Netlify/Decap CMS because Sveltia CMS uses your auth token stored in the browser. Simple enough!
|
|
268
283
|
|
|
269
|
-
That said, we strongly recommend testing your new Sveltia CMS instance first on your local machine. [See below](#
|
|
284
|
+
That said, we strongly recommend testing your new Sveltia CMS instance first on your local machine. [See below](#working-with-a-local-git-repository) for how.
|
|
285
|
+
|
|
286
|
+
For advanced users, we have also made the bundle available as an [npm package](https://www.npmjs.com/package/@sveltia/cms). You can install it by running `npm i @sveltia/cms` or `pnpm add @sveltia/cms` on your project. The [manual initialization](https://decapcms.org/docs/manual-initialization/) flow with the `init` method is the same as for Netlify/Decap CMS. Make sure to keep the dependency up to date!
|
|
287
|
+
|
|
288
|
+
### Updates
|
|
289
|
+
|
|
290
|
+
Updating Sveltia CMS is transparent, unless you include a specific version in the `<script>` source URL. 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.
|
|
270
291
|
|
|
271
292
|
## Tips & tricks
|
|
272
293
|
|
|
273
|
-
###
|
|
294
|
+
### Moving your site from Netlify to another hosting service
|
|
274
295
|
|
|
275
296
|
You can host your Sveltia CMS-managed site anywhere, such as [Cloudflare Pages](https://pages.cloudflare.com/) or [GitHub Pages](https://pages.github.com/). But moving away from Netlify means you can no longer sign in with GitHub or GitLab via Netlify. Instead, you can use [our own OAuth client](https://github.com/sveltia/sveltia-cms-auth), which can be easily deployed to Cloudflare Workers, or [any other 3rd party client](https://decapcms.org/docs/external-oauth-clients/) made for Netlify/Decap CMS.
|
|
276
297
|
|
|
277
|
-
###
|
|
298
|
+
### Working with a local Git repository
|
|
278
299
|
|
|
279
300
|
You can use Sveltia CMS with a local Git repository like [Netlify/Decap CMS](https://decapcms.org/docs/working-with-a-local-git-repository/), but Sveltia CMS has simplified the workflow by removing the need for additional configuration (the `local_backend` property) and proxy server, thanks to the [File System Access API](https://developer.chrome.com/articles/file-system-access/) available in [some modern browsers](https://developer.mozilla.org/en-US/docs/web/api/window/showopenfilepicker#browser_compatibility).
|
|
280
301
|
|
|
@@ -291,7 +312,7 @@ You can use Sveltia CMS with a local Git repository like [Netlify/Decap CMS](htt
|
|
|
291
312
|
|
|
292
313
|
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).
|
|
293
314
|
|
|
294
|
-
###
|
|
315
|
+
### Using a custom icon for a collection
|
|
295
316
|
|
|
296
317
|
You can have an icon for each collection for easy identification in the collection list.
|
|
297
318
|
|
|
@@ -310,7 +331,7 @@ You can have an icon for each collection for easy identification in the collecti
|
|
|
310
331
|
folder: data/tags/
|
|
311
332
|
```
|
|
312
333
|
|
|
313
|
-
###
|
|
334
|
+
### Using a custom media folder for a collection
|
|
314
335
|
|
|
315
336
|
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.
|
|
316
337
|
|
|
@@ -331,7 +352,7 @@ Rather, if you’d like to add all the media files for a collection in one singl
|
|
|
331
352
|
|
|
332
353
|
In Sveltia CMS, those per-collection media folders are displayed prominently for easier asset management.
|
|
333
354
|
|
|
334
|
-
###
|
|
355
|
+
### Using DeepL to translate entry fields
|
|
335
356
|
|
|
336
357
|
Sveltia CMS comes with a handy DeepL integration so that you can translate any text field from another locale without leaving the content editor. To enable the high-quality, quick translation feature:
|
|
337
358
|
|
|
@@ -342,7 +363,7 @@ Sveltia CMS comes with a handy DeepL integration so that you can translate any t
|
|
|
342
363
|
1. Open any entry, and you can now translate all fields or individual fields by selecting Translate from the three-dot menu.
|
|
343
364
|
1. If you have upgraded to DeepL API Pro, provide your new Authentication Key in the same way.
|
|
344
365
|
|
|
345
|
-
###
|
|
366
|
+
### Disabling non-default locale content
|
|
346
367
|
|
|
347
368
|
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.
|
|
348
369
|
|
|
@@ -356,7 +377,7 @@ With the following configuration, you can disable the French and/or German trans
|
|
|
356
377
|
+ save_all_locales: false
|
|
357
378
|
```
|
|
358
379
|
|
|
359
|
-
###
|
|
380
|
+
### Using a random ID for an entry slug
|
|
360
381
|
|
|
361
382
|
By default, the [slug for a new entry file](https://decapcms.org/docs/configuration-options/#slug) will be generated based on the entry’s `title` field. Or, you can specify the collection’s `slug` option to use the file creation date or other fields. While the behaviour is generally acceptable and SEO-friendly, it’s not useful if the title might change later or if it contains non-Latin characters like Chinese. In Sveltia CMS, you can easily generate a random [UUID](https://developer.mozilla.org/en-US/docs/Glossary/UUID) for a slug without a custom widget!
|
|
362
383
|
|
|
@@ -370,7 +391,7 @@ It’s simple — just specify `{{uuid}}` (full UUID v4), `{{uuid_short}}` (last
|
|
|
370
391
|
+ slug: '{{uuid_short}}'
|
|
371
392
|
```
|
|
372
393
|
|
|
373
|
-
###
|
|
394
|
+
### Disabling automatic deployments
|
|
374
395
|
|
|
375
396
|
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.
|
|
376
397
|
|
|
@@ -409,7 +430,7 @@ If the `automatic_deployments` property is defined, you can manually trigger a d
|
|
|
409
430
|
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/).
|
|
410
431
|
1. Configure the CSP if necessary. See below.
|
|
411
432
|
|
|
412
|
-
###
|
|
433
|
+
### Setting up Content Security Policy
|
|
413
434
|
|
|
414
435
|
If your site adopts Content Security Policy (CSP), use the following policy for Sveltia CMS, or some features may not work.
|
|
415
436
|
|
|
@@ -433,7 +454,7 @@ And combine the following policies depending on your Git backend and enabled int
|
|
|
433
454
|
- GitLab: (If you’re running a self-hosted instance, you’ll also need to add the origin to these directives.)
|
|
434
455
|
```csp
|
|
435
456
|
img-src https://gitlab.com https://secure.gravatar.com;
|
|
436
|
-
connect-src https://gitlab.com;
|
|
457
|
+
connect-src https://gitlab.com https://status-api.hostedstatus.com;
|
|
437
458
|
```
|
|
438
459
|
- Pexels:
|
|
439
460
|
```csp
|
|
@@ -459,7 +480,7 @@ And combine the following policies depending on your Git backend and enabled int
|
|
|
459
480
|
connect-src https://api.deepl.com;
|
|
460
481
|
```
|
|
461
482
|
|
|
462
|
-
If you choose to [disable automatic deployments](#
|
|
483
|
+
If you choose to [disable automatic deployments](#disabling-automatic-deployments) and have configured a webhook URL, you may need to add the origin to the `connect-src` directive. For example,
|
|
463
484
|
|
|
464
485
|
- Netlify:
|
|
465
486
|
```csp
|
|
@@ -476,16 +497,6 @@ If you have image field(s) and expect that images will be inserted as URLs, you
|
|
|
476
497
|
img-src 'self' blob: data: https://*;
|
|
477
498
|
```
|
|
478
499
|
|
|
479
|
-
### Self-host the CMS
|
|
480
|
-
|
|
481
|
-
Sveltia CMS is open source for sure! You can host it on your server rather than loading it from UNPKG, though it’s not recommended due to missing bug fixes. Simply copy the latest [`sveltia-cms.js`](https://unpkg.com/@sveltia/cms/dist/sveltia-cms.js) file from the CDN, or build it yourself:
|
|
482
|
-
|
|
483
|
-
1. Clone this Git repository.
|
|
484
|
-
1. Run `pnpm install && pnpm build` at the project root.
|
|
485
|
-
1. `sveltia-cms.js` will be generated under the `dist` directory.
|
|
486
|
-
|
|
487
|
-
Importing the CMS as an npm package is not supported yet.
|
|
488
|
-
|
|
489
500
|
## Support & feedback
|
|
490
501
|
|
|
491
502
|
Visit the [Discussions](https://github.com/sveltia/sveltia-cms/discussions) page on this GitHub repository and start a new discussion. Tell us about your use cases!
|
|
@@ -540,7 +551,7 @@ This software is provided “as is” without any express or implied warranty. W
|
|
|
540
551
|
[^29]: Netlify/Decap CMS [#4783](https://github.com/decaporg/decap-cms/issues/4783)
|
|
541
552
|
[^30]: Netlify/Decap CMS [#565](https://github.com/decaporg/decap-cms/issues/565)
|
|
542
553
|
[^31]: Netlify/Decap CMS [#1045](https://github.com/decaporg/decap-cms/issues/1045), [#3353](https://github.com/decaporg/decap-cms/issues/3353)
|
|
543
|
-
[^32]: Netlify/Decap CMS [#302](https://github.com/decaporg/decap-cms/issues/302), [#5549](https://github.com/decaporg/decap-cms/issues/5549)
|
|
554
|
+
[^32]: Netlify/Decap CMS [#302](https://github.com/decaporg/decap-cms/issues/302), [#5549](https://github.com/decaporg/decap-cms/issues/5549), [#6034](https://github.com/decaporg/decap-cms/issues/6034)
|
|
544
555
|
[^33]: Netlify/Decap CMS [#6513](https://github.com/decaporg/decap-cms/issues/6513)
|
|
545
556
|
[^34]: Netlify/Decap CMS [#2138](https://github.com/decaporg/decap-cms/issues/2138)
|
|
546
557
|
[^35]: Netlify/Decap CMS [#7086](https://github.com/decaporg/decap-cms/issues/7086)
|
|
@@ -558,5 +569,11 @@ This software is provided “as is” without any express or implied warranty. W
|
|
|
558
569
|
[^47]: Netlify/Decap CMS [#2370](https://github.com/decaporg/decap-cms/issues/2370), [#5596](https://github.com/decaporg/decap-cms/issues/5596)
|
|
559
570
|
[^48]: Netlify/Decap CMS [#5569](https://github.com/decaporg/decap-cms/issues/5569)
|
|
560
571
|
[^49]: Netlify/Decap CMS [#5752](https://github.com/decaporg/decap-cms/issues/5752)
|
|
561
|
-
[^50]: Netlify/Decap CMS [#4646](https://github.com/decaporg/decap-cms/issues/4646)
|
|
572
|
+
[^50]: Netlify/Decap CMS [#4646](https://github.com/decaporg/decap-cms/issues/4646), [#7167](https://github.com/decaporg/decap-cms/issues/7167)
|
|
562
573
|
[^51]: Netlify/Decap CMS [#6731](https://github.com/decaporg/decap-cms/issues/6731)
|
|
574
|
+
[^52]: Netlify/Decap CMS [#7147](https://github.com/decaporg/decap-cms/issues/7147)
|
|
575
|
+
[^53]: Netlify/Decap CMS [#5673](https://github.com/decaporg/decap-cms/issues/5673), [#6482](https://github.com/decaporg/decap-cms/issues/6482), [#6707](https://github.com/decaporg/decap-cms/issues/6707), [#6999](https://github.com/decaporg/decap-cms/issues/6999), [#7047](https://github.com/decaporg/decap-cms/issues/7047), [#7123](https://github.com/decaporg/decap-cms/issues/7123), [#7152](https://github.com/decaporg/decap-cms/issues/7152)
|
|
576
|
+
[^54]: Netlify/Decap CMS [#1347](https://github.com/decaporg/decap-cms/issues/1347), [#4629](https://github.com/decaporg/decap-cms/issues/4629), [#6287](https://github.com/decaporg/decap-cms/issues/6287) — Decap 3.0 updated the Slate editor in an attempt to fix the problems, but the IME issues remain unresolved when using a mobile/tablet browser.
|
|
577
|
+
[^55]: Netlify/Decap CMS [#4480](https://github.com/decaporg/decap-cms/issues/4480), [#6353](https://github.com/decaporg/decap-cms/issues/6353)
|
|
578
|
+
[^56]: Netlify/Decap CMS [#6515](https://github.com/decaporg/decap-cms/issues/6515)
|
|
579
|
+
[^57]: Netlify/Decap CMS [#328](https://github.com/decaporg/decap-cms/issues/328), [#3853](https://github.com/decaporg/decap-cms/issues/3853)
|