@sveltia/cms 0.2.1 → 0.2.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 +18 -7
- package/dist/sveltia-cms.js +212 -181
- package/package.json +12 -12
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Sveltia CMS
|
|
2
2
|
|
|
3
|
-
Sveltia CMS is a Git-based lightweight headless CMS partially compatible with [Netlify/Decap CMS](https://decapcms.org/). You can use it with any static site generator, such as SvelteKit, Next.js and Hugo, to manage the content as static files on a Git repository. The
|
|
3
|
+
Sveltia CMS is a Git-based lightweight headless CMS partially compatible with [Netlify/Decap CMS](https://decapcms.org/). You can use it with any static site generator, such as SvelteKit, Next.js and Hugo, to manage the content as static files on a Git repository. The open source Netlify/Decap CMS alternative is now in public beta, with more features to come.
|
|
4
4
|
|
|
5
5
|
<br>
|
|
6
6
|
|
|
@@ -16,7 +16,7 @@ Sveltia CMS is a Git-based lightweight headless CMS partially compatible with [N
|
|
|
16
16
|
|
|
17
17
|
Sveltia CMS is a Git-based lightweight headless CMS, which means:
|
|
18
18
|
|
|
19
|
-
- Git-based:
|
|
19
|
+
- Git-based: The content is saved as static JSON, YAML or TOML files on your Git repository. No 3rd party database or API is involved. Your data is yours.
|
|
20
20
|
- Lightweight: The app is compiled as a single small JavaScript file served via a CDN. You don’t have to sign up for a service or install additional software.
|
|
21
21
|
- Headless: The CMS only takes care of raw data. You can read it and render the final content with your favourite framework.
|
|
22
22
|
|
|
@@ -51,7 +51,7 @@ Here are some highlights mainly compared to Netlify/Decap CMS:
|
|
|
51
51
|
|
|
52
52
|
- Making it easier to switch between locales while editing.
|
|
53
53
|
- Integrating DeepL to allow translating text fields from another locale with one click. [See below](#use-deepl-to-translate-entry-fields) for details.
|
|
54
|
-
- You can now use a random
|
|
54
|
+
- You can now use a random UUID for an entry slug, which is a good option for locales writing in non-Latin characters[^12]. [See below](#use-a-random-id-for-an-entry-slug) for details.
|
|
55
55
|
- Solving limitations in Netlify/Decap CMS’s [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[^7].
|
|
56
56
|
- Users can now choose their preferred UI locale.
|
|
57
57
|
|
|
@@ -147,7 +147,7 @@ Here are some starter templates for popular frameworks created by our contributo
|
|
|
147
147
|
|
|
148
148
|
### Migration
|
|
149
149
|
|
|
150
|
-
If you’re already using Netlify/Decap CMS with the GitHub backend and don’t have any custom widget, custom preview or plugin, migrating to Sveltia CMS is super easy. Edit `/admin/index.html` to replace the CMS script tag, and push the change to your repository:
|
|
150
|
+
If you’re already using Netlify/Decap CMS with the GitHub backend and don’t have any custom widget, custom preview or plugin, migrating to Sveltia CMS is super easy. Edit `/admin/index.html` to replace the CMS `script` tag, and push the change to your repository:
|
|
151
151
|
|
|
152
152
|
```diff
|
|
153
153
|
-<script src="https://unpkg.com/netlify-cms@^2.0.0/dist/netlify-cms.js"></script>
|
|
@@ -176,7 +176,7 @@ You can use Sveltia CMS with a local Git repository, just like the [beta feature
|
|
|
176
176
|
1. Visit `http://localhost:[port]/admin/index.html` with [Chrome, Edge or other Chromium-based browser](https://developer.mozilla.org/en-US/docs/web/api/window/showopenfilepicker#browser_compatibility). The port number depends on your framework.
|
|
177
177
|
1. Click “Work with Local Repository” and select the project’s root directory once prompted.
|
|
178
178
|
1. Make some changes on Sveltia CMS.
|
|
179
|
-
1. See if the produced changes look good using `git diff` or a GUI like GitHub Desktop.
|
|
179
|
+
1. See if the produced changes look good using `git diff` or a GUI like [GitHub Desktop](https://desktop.github.com/).
|
|
180
180
|
1. Commit and push the changes if satisfied, or discard them if you’re just testing.
|
|
181
181
|
|
|
182
182
|
### Use a custom icon for a collection
|
|
@@ -233,7 +233,7 @@ Sveltia CMS comes with a handy DeepL integration so that you can translate any t
|
|
|
233
233
|
|
|
234
234
|
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) without a custom widget!
|
|
235
235
|
|
|
236
|
-
It’s simple — just specify `{{uuid}}` (full UUID v4)
|
|
236
|
+
It’s simple — just specify `{{uuid}}` (full UUID v4), `{{uuid_short}}` (last 12 characters only) or `{{uuid_shorter}}` (first 8 characters only) in the `slug` option. The results would look like `4fc0917c-8aea-4ad5-a476-392bdcf3b642`, `392bdcf3b642` and `4fc0917c`, respectively.
|
|
237
237
|
|
|
238
238
|
```diff
|
|
239
239
|
- name: members
|
|
@@ -292,6 +292,16 @@ If you have image field(s) and expect that images will be inserted as URLs, you
|
|
|
292
292
|
img-src 'self' blob: data: https://*;
|
|
293
293
|
```
|
|
294
294
|
|
|
295
|
+
### Self-host the CMS
|
|
296
|
+
|
|
297
|
+
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:
|
|
298
|
+
|
|
299
|
+
1. Clone this Git repository.
|
|
300
|
+
1. Run `pnpm install && pnpm build` at the project root.
|
|
301
|
+
1. `sveltia-cms.js` will be generated under the `dist` directory.
|
|
302
|
+
|
|
303
|
+
Importing the CMS as an npm package is not supported yet.
|
|
304
|
+
|
|
295
305
|
## Support & feedback
|
|
296
306
|
|
|
297
307
|
Visit the [Discussions](https://github.com/sveltia/sveltia-cms/discussions) page on this GitHub repository and start a new discussion. Tell us your use cases!
|
|
@@ -302,7 +312,7 @@ Feel free to [file an issue](https://github.com/sveltia/sveltia-cms/issues/new)
|
|
|
302
312
|
|
|
303
313
|
## Links
|
|
304
314
|
|
|
305
|
-
- Introducing Sveltia CMS: a short 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)
|
|
315
|
+
- 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)
|
|
306
316
|
|
|
307
317
|
## Disclaimer
|
|
308
318
|
|
|
@@ -317,3 +327,4 @@ This software is provided “as is” without any express or implied warranty. T
|
|
|
317
327
|
[^7]: [Netlify/Decap CMS #4386](https://github.com/netlify/netlify-cms/issues/4386)
|
|
318
328
|
[^10]: [Netlify/Decap CMS #341](https://github.com/netlify/netlify-cms/issues/341)
|
|
319
329
|
[^11]: [Netlify/Decap CMS #1382](https://github.com/netlify/netlify-cms/issues/1382) and many more. We’ll be updating this list after reviewing their issue list.
|
|
330
|
+
[^12]: [Netlify/Decap CMS #1975](https://github.com/decaporg/decap-cms/issues/1975)
|