@sveltia/cms 0.14.1 → 0.16.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 +14 -8
- package/dist/sveltia-cms.js +233 -169
- package/package.json +9 -8
package/README.md
CHANGED
|
@@ -43,14 +43,14 @@ We are working hard to create a **much better alternative to Netlify/Decap CMS**
|
|
|
43
43
|
|
|
44
44
|
- 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
45
|
- Small footprint: The bundle size is less than 300 KB when minified and gzipped, compared to 1.5 MB of Netlify/Decap CMS. And [no virtual DOM overhead](https://svelte.dev/blog/virtual-dom-is-pure-overhead).
|
|
46
|
-
- Uses the GraphQL API for GitHub 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].
|
|
46
|
+
- Uses the GraphQL API for GitHub/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
47
|
- 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/).
|
|
48
48
|
- Caches Git files locally to further speed up startup and reduce bandwidth.
|
|
49
49
|
- 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].
|
|
50
50
|
|
|
51
51
|
### Better productivity
|
|
52
52
|
|
|
53
|
-
- You can [work
|
|
53
|
+
- You can [work with a local Git repository](#work-with-a-local-git-repository) without running a proxy server on your machine, bypassing the 30 MB file size limit[^26].
|
|
54
54
|
- 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].
|
|
55
55
|
- Never miss out on the latest features and bug fixes by being notified when an update to the CMS is available[^31].
|
|
56
56
|
- You can delete multiple entries and assets at once.
|
|
@@ -138,7 +138,7 @@ While it’s not our goal to recreate all the features found in Netlify/Decap CM
|
|
|
138
138
|
| Feature | Status in Sveltia CMS |
|
|
139
139
|
| --- | --- |
|
|
140
140
|
| Installation | Installing with `npm` is not supported yet. |
|
|
141
|
-
| Backends |
|
|
141
|
+
| Backends | Currently only the GitHub and GitLab backends are available. Sveltia CMS uses the GraphQL API by default for better performance; it cannot be disabled. We’ll also add the Test backend for our demo site, but Azure, Bitbucket and Gitea are unlikely to be supported, mainly due to the lack of a method to fetch content in bulk. |
|
|
142
142
|
| Netlify Integration | Identity Widget is not supported yet. We will not support Git Gateway due to the poor performance; we may implement an alternative using GraphQL later. |
|
|
143
143
|
| Local Git Repository | Supported using a different approach. [See below](#work-with-a-local-git-repository) for details. |
|
|
144
144
|
| UI Locales | Only English and Japanese are available at this time. No registration is needed. While the UI locale is automatically selected depending on the browser’s language settings, it can be changed in Settings. (Click on the Account button in the top right corner of the CMS.) |
|
|
@@ -205,14 +205,14 @@ Alternatively, you can probably use one of the [Netlify/Decap CMS templates](htt
|
|
|
205
205
|
|
|
206
206
|
### Migration
|
|
207
207
|
|
|
208
|
-
Have a look at the [compatibility chart](#compatibility) above first. 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:
|
|
208
|
+
Have a look at the [compatibility chart](#compatibility) above first. If you’re already using Netlify/Decap CMS with the GitHub/GitLab 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:
|
|
209
209
|
|
|
210
210
|
```diff
|
|
211
211
|
-<script src="https://unpkg.com/netlify-cms@^2.0.0/dist/netlify-cms.js"></script>
|
|
212
212
|
+<script src="https://unpkg.com/@sveltia/cms/dist/sveltia-cms.js" type="module"></script>
|
|
213
213
|
```
|
|
214
214
|
|
|
215
|
-
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 on Netlify/Decap CMS because Sveltia CMS uses your auth token stored in the browser. Simple enough!
|
|
215
|
+
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/GitLab on Netlify/Decap CMS because Sveltia CMS uses your auth token stored in the browser. Simple enough!
|
|
216
216
|
|
|
217
217
|
That said, we strongly recommend testing your new Sveltia CMS instance first on your local machine. [See below](#work-with-a-local-git-repository) for how.
|
|
218
218
|
|
|
@@ -220,7 +220,7 @@ That said, we strongly recommend testing your new Sveltia CMS instance first on
|
|
|
220
220
|
|
|
221
221
|
### Move your site from Netlify to another hosting service
|
|
222
222
|
|
|
223
|
-
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 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.
|
|
223
|
+
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/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.
|
|
224
224
|
|
|
225
225
|
### Work with a local Git repository
|
|
226
226
|
|
|
@@ -230,6 +230,7 @@ You can use Sveltia CMS with a local Git repository like [Netlify/Decap CMS](htt
|
|
|
230
230
|
1. Visit `http://localhost:[port]/admin/index.html` with Chrome or Edge. The port number varies by framework.
|
|
231
231
|
- Other Chromium-based browsers may also work. In Brave, you need to enable the File System Access API [with a flag](https://github.com/brave/brave-browser/issues/20563#issuecomment-1021567573).
|
|
232
232
|
1. Click “Work with Local Repository” and select the project’s root directory once prompted.
|
|
233
|
+
- If you get an error saying “not a repository root directory”, make sure you’ve turned the folder into a repository with either CUI ([`git init`](https://github.com/git-guides/git-init)) or GUI, and the hidden `.git` folder exists.
|
|
233
234
|
- If you’re using Windows Subsystem for Linux (WSL), you may get an error saying “Can’t open this folder because it contains system files.” This is due to a limitation in the browser, and you can try some workarounds mentioned in [this issue](https://github.com/coder/code-server/issues/4646) and [this thread](https://github.com/sveltia/sveltia-cms/discussions/101).
|
|
234
235
|
1. Make some changes to your content on Sveltia CMS.
|
|
235
236
|
1. See if the produced changes look good using `git diff` or a GUI like [GitHub Desktop](https://desktop.github.com/).
|
|
@@ -372,11 +373,16 @@ connect-src 'self' blob: data:;
|
|
|
372
373
|
|
|
373
374
|
And combine the following policies depending on your Git backend and enabled integrations.
|
|
374
375
|
|
|
375
|
-
- GitHub:
|
|
376
|
+
- GitHub: (If you’re running GitHub Enterprise Server, you’ll also need to add the origin to these directives.)
|
|
376
377
|
```csp
|
|
377
|
-
img-src https
|
|
378
|
+
img-src https://*.githubusercontent.com
|
|
378
379
|
connect-src https://api.github.com https://www.githubstatus.com;
|
|
379
380
|
```
|
|
381
|
+
- GitLab: (If you’re running a self-hosted instance, you’ll also need to add the origin to these directives.)
|
|
382
|
+
```csp
|
|
383
|
+
img-src https://gitlab.com https://secure.gravatar.com;
|
|
384
|
+
connect-src https://gitlab.com;
|
|
385
|
+
```
|
|
380
386
|
- Pexels:
|
|
381
387
|
```csp
|
|
382
388
|
img-src https://images.pexels.com;
|