@sveltia/cms 0.104.1 → 0.104.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 +51 -24
- package/dist/sveltia-cms.js +143 -164
- package/dist/sveltia-cms.js.map +1 -1
- package/dist/sveltia-cms.mjs +143 -164
- package/dist/sveltia-cms.mjs.map +1 -1
- package/package.json +1 -1
- package/schema/sveltia-cms.json +4 -0
package/README.md
CHANGED
|
@@ -473,7 +473,7 @@ Sveltia CMS supports all the [built-in widgets](https://decapcms.org/docs/widget
|
|
|
473
473
|
- A combination of bold and italic doesn’t create a confusing 3-asterisk markup.[^160] In our editor, bold is 2 asterisks and italic is an underscore.
|
|
474
474
|
- The built-in `image` component can be inserted with a single click.
|
|
475
475
|
- The built-in `image` component allows users to add, edit or remove a link on an image.[^171] To disable this feature, add `linked_images: false` to the Markdown field options.
|
|
476
|
-
- It’s possible to paste/drop local/remote images into the rich text editor to insert them as expected. Note: Pasting multiple images is [not supported in Firefox](https://bugzilla.mozilla.org/show_bug.cgi?id=864052). In Netlify/Decap CMS, pasting an image may cause the application to crash.
|
|
476
|
+
- It’s possible to paste/drop local/remote images into the rich text editor to insert them as expected. Note: Pasting multiple images is [not supported in Firefox](https://bugzilla.mozilla.org/show_bug.cgi?id=864052). In Netlify/Decap CMS, pasting an image may cause the application to crash.[^284]
|
|
477
477
|
- The built-in `code-block` component is implemented just like a blockquote. You can simply convert a normal paragraph into a code block instead of adding a component.
|
|
478
478
|
- Code in a code block in the editor can be copied as expected.[^165]
|
|
479
479
|
- Language-annotated code block doesn’t trigger unsaved changes.[^189]
|
|
@@ -807,32 +807,40 @@ You can also generate a personal access token (PAT) on GitHub or GitLab, and use
|
|
|
807
807
|
|
|
808
808
|
Sveltia CMS provides a full [JSON schema](https://json-schema.org/) for the configuration file, so you can get autocomplete and validation in your favourite code editor while editing the site configuration. The schema is generated from the source and always up to date with the latest CMS version.
|
|
809
809
|
|
|
810
|
-
If you use VS Code, you can enable it for the YAML configuration file by installing the [YAML extension](https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml) and adding the following to
|
|
810
|
+
If you use VS Code, you can enable it for the YAML configuration file by installing the [YAML extension](https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml) and adding the following comment to the top of `config.yml`:
|
|
811
811
|
|
|
812
|
-
```
|
|
813
|
-
|
|
814
|
-
"yaml.schemas": {
|
|
815
|
-
"https://unpkg.com/@sveltia/cms/schema/sveltia-cms.json": ["/static/admin/config.yml"]
|
|
816
|
-
}
|
|
817
|
-
}
|
|
812
|
+
```yaml
|
|
813
|
+
# yaml-language-server: $schema=https://unpkg.com/@sveltia/cms/schema/sveltia-cms.json
|
|
818
814
|
```
|
|
819
815
|
|
|
820
|
-
If your configuration is in JSON format (see the [next section](#providing-a-json-configuration-file)), no extension is needed. Just add the following to the
|
|
816
|
+
If your configuration is in JSON format (see the [next section](#providing-a-json-configuration-file)), no extension is needed. Just add the following line to the top of `config.json`, within the curly braces:
|
|
821
817
|
|
|
822
818
|
```json
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
819
|
+
"$schema": "https://unpkg.com/@sveltia/cms/schema/sveltia-cms.json",
|
|
820
|
+
```
|
|
821
|
+
|
|
822
|
+
Alternatively, you can add the following to your project’s [VS Code settings file](https://code.visualstudio.com/docs/configure/settings#_settings-json-file) at `.vscode/settings.json`, within the outer curly braces:
|
|
823
|
+
|
|
824
|
+
```jsonc
|
|
825
|
+
// For YAML config file
|
|
826
|
+
"yaml.schemas": {
|
|
827
|
+
"https://unpkg.com/@sveltia/cms/schema/sveltia-cms.json": ["/static/admin/config.yml"]
|
|
828
|
+
},
|
|
829
|
+
```
|
|
830
|
+
|
|
831
|
+
```jsonc
|
|
832
|
+
// For JSON config file
|
|
833
|
+
"json.schemas": [
|
|
834
|
+
{
|
|
835
|
+
"fileMatch": ["/static/admin/config.json"],
|
|
836
|
+
"url": "https://unpkg.com/@sveltia/cms/schema/sveltia-cms.json"
|
|
837
|
+
}
|
|
838
|
+
],
|
|
831
839
|
```
|
|
832
840
|
|
|
833
841
|
The configuration file location varies by framework and project structure, so adjust the path accordingly. For example, if you use Astro, the file is typically located in the `/public/admin/` directory.
|
|
834
842
|
|
|
835
|
-
If you use another code editor, check its documentation for how to enable JSON schema support for YAML or JSON files.
|
|
843
|
+
If you use another code editor, check its documentation for how to enable JSON schema support for YAML or JSON files.
|
|
836
844
|
|
|
837
845
|
### Providing a JSON configuration file
|
|
838
846
|
|
|
@@ -1122,7 +1130,15 @@ The configuration for a [file collection](https://decapcms.org/docs/collection-f
|
|
|
1122
1130
|
|
|
1123
1131
|
### Translating entry fields with one click
|
|
1124
1132
|
|
|
1125
|
-
Sveltia CMS comes with a handy translation API integration so that you can translate any text field from another locale without leaving the Content Editor. Currently,
|
|
1133
|
+
Sveltia CMS comes with a handy translation API integration so that you can translate any text field from another locale without leaving the Content Editor. Currently, the following services are supported:
|
|
1134
|
+
|
|
1135
|
+
- Google’s [Cloud Translation](https://cloud.google.com/translate)
|
|
1136
|
+
- Anthropic’s [Claude Haiku 3.5](https://www.anthropic.com/claude/haiku)
|
|
1137
|
+
- OpenAI’s [GPT-4o mini](https://platform.openai.com/docs/models/gpt-4o-mini)
|
|
1138
|
+
|
|
1139
|
+
Google’s API is very fast and offers a free tier. Other LLMs may produce more natural translations, but they are slower and require a paid plan. Choose the one that best fits your needs.
|
|
1140
|
+
|
|
1141
|
+
To enable the quick translation feature:
|
|
1126
1142
|
|
|
1127
1143
|
1. Update your configuration file to enable the [i18n support](https://decapcms.org/docs/i18n/) with multiple locales.
|
|
1128
1144
|
1. Create a new API key for the translation service of your choice:
|
|
@@ -1143,11 +1159,20 @@ Sveltia CMS comes with a handy translation API integration so that you can trans
|
|
|
1143
1159
|
1. Select a translation service from the dropdown menu and paste your API key when prompted.
|
|
1144
1160
|
1. The field(s) will be automatically translated.
|
|
1145
1161
|
|
|
1146
|
-
You can also provide your API keys in the Settings dialog.
|
|
1147
|
-
|
|
1148
1162
|
Note that the Translation button on the pane header only translates empty fields, while in-field Translation buttons override any filled text.
|
|
1149
1163
|
|
|
1150
|
-
|
|
1164
|
+
You can also provide your API keys in the Settings dialog or change the default translation service. API keys are stored in the browser’s local storage, so you don’t need to enter them every time.
|
|
1165
|
+
|
|
1166
|
+
If you don’t want some text to be translated, use the HTML [`translate`](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Global_attributes/translate) attribute or [`notranslate`](https://developers.google.com/search/blog/2008/10/helping-you-break-language-barrier) class. For Anthropic and OpenAI, you can also use the `notranslate` comment to exclude specific parts of Markdown content from translation:
|
|
1167
|
+
|
|
1168
|
+
```html
|
|
1169
|
+
<div translate="no">...</div>
|
|
1170
|
+
<span class="notranslate">...</span>
|
|
1171
|
+
<!-- notranslate -->...<!-- /notranslate -->
|
|
1172
|
+
{/* notranslate */}...{/* /notranslate */}
|
|
1173
|
+
```
|
|
1174
|
+
|
|
1175
|
+
Earlier versions of Sveltia CMS included DeepL integration, but we had to disable it [due to an API limitation](https://github.com/sveltia/sveltia-cms/issues/437). More translation services will be added in the future.
|
|
1151
1176
|
|
|
1152
1177
|
### Localizing entry slugs
|
|
1153
1178
|
|
|
@@ -1802,7 +1827,7 @@ Due early 2026
|
|
|
1802
1827
|
|
|
1803
1828
|
## Trivia
|
|
1804
1829
|
|
|
1805
|
-
- The [original version of Netlify CMS](https://github.com/netlify/netlify-cms-legacy) was built with Ember before being rewritten in React. There was also an [attempt](https://github.com/decaporg/decap-cms/issues/328) to replace React with Preact. Now we have completely
|
|
1830
|
+
- The [original version of Netlify CMS](https://github.com/netlify/netlify-cms-legacy) was built with Ember before being rewritten in React. There was also an [attempt](https://github.com/decaporg/decap-cms/issues/328) to replace React with Preact. Now we have completely rebuilt it in Svelte 4 and then in Svelte 5. So this is effectively the third/fourth time the application has gone through a framework migration. One more thing: We may migrate to [Ripple](https://www.ripplejs.com/) in the future if it looks promising.
|
|
1806
1831
|
- Our [local repository workflow](#working-with-a-local-git-repository) shares implementation with the Test backend, as both utilize the [File System API](https://developer.mozilla.org/en-US/docs/Web/API/File_System_API), allowing us to reduce maintenance costs. The seamless local workflow is critical not only for improved DX, but also for our rapid application development.
|
|
1807
1832
|
|
|
1808
1833
|
## Related Links
|
|
@@ -1962,7 +1987,7 @@ This software is provided “as is” without any express or implied warranty. W
|
|
|
1962
1987
|
|
|
1963
1988
|
[^72]: Netlify/Decap CMS [#7047](https://github.com/decaporg/decap-cms/issues/7047)
|
|
1964
1989
|
|
|
1965
|
-
[^73]: Netlify/Decap CMS [#6993](https://github.com/decaporg/decap-cms/issues/6993), [#7123](https://github.com/decaporg/decap-cms/issues/7123), [#7127](https://github.com/decaporg/decap-cms/issues/7127), [#7128](https://github.com/decaporg/decap-cms/issues/7128), [#7237](https://github.com/decaporg/decap-cms/issues/7237), [#7251](https://github.com/decaporg/decap-cms/issues/7251), [#7361](https://github.com/decaporg/decap-cms/issues/7361), [#7391](https://github.com/decaporg/decap-cms/issues/7391), [#7393](https://github.com/decaporg/decap-cms/issues/7393), [#7470](https://github.com/decaporg/decap-cms/issues/7470), [#7475](https://github.com/decaporg/decap-cms/issues/7475), [#7480](https://github.com/decaporg/decap-cms/issues/7480), [#7503](https://github.com/decaporg/decap-cms/issues/7503), [#7504](https://github.com/decaporg/decap-cms/issues/7504), [#7524](https://github.com/decaporg/decap-cms/issues/7524), [#7531](https://github.com/decaporg/decap-cms/issues/7531), [#7535](https://github.com/decaporg/decap-cms/issues/7535), [#7553](https://github.com/decaporg/decap-cms/issues/7553), [#7561](https://github.com/decaporg/decap-cms/issues/7561), [#7584](https://github.com/decaporg/decap-cms/issues/7584)
|
|
1990
|
+
[^73]: Netlify/Decap CMS [#6993](https://github.com/decaporg/decap-cms/issues/6993), [#7123](https://github.com/decaporg/decap-cms/issues/7123), [#7127](https://github.com/decaporg/decap-cms/issues/7127), [#7128](https://github.com/decaporg/decap-cms/issues/7128), [#7237](https://github.com/decaporg/decap-cms/issues/7237), [#7251](https://github.com/decaporg/decap-cms/issues/7251), [#7361](https://github.com/decaporg/decap-cms/issues/7361), [#7391](https://github.com/decaporg/decap-cms/issues/7391), [#7393](https://github.com/decaporg/decap-cms/issues/7393), [#7470](https://github.com/decaporg/decap-cms/issues/7470), [#7475](https://github.com/decaporg/decap-cms/issues/7475), [#7480](https://github.com/decaporg/decap-cms/issues/7480), [#7503](https://github.com/decaporg/decap-cms/issues/7503), [#7504](https://github.com/decaporg/decap-cms/issues/7504), [#7524](https://github.com/decaporg/decap-cms/issues/7524), [#7531](https://github.com/decaporg/decap-cms/issues/7531), [#7535](https://github.com/decaporg/decap-cms/issues/7535), [#7553](https://github.com/decaporg/decap-cms/issues/7553), [#7561](https://github.com/decaporg/decap-cms/issues/7561), [#7584](https://github.com/decaporg/decap-cms/issues/7584), [#7591](https://github.com/decaporg/decap-cms/issues/7591)
|
|
1966
1991
|
|
|
1967
1992
|
[^74]: Netlify/Decap CMS [#4209](https://github.com/decaporg/decap-cms/issues/4209)
|
|
1968
1993
|
|
|
@@ -2383,3 +2408,5 @@ This software is provided “as is” without any express or implied warranty. W
|
|
|
2383
2408
|
[^282]: Netlify/Decap CMS [#7579](https://github.com/decaporg/decap-cms/pull/7579)
|
|
2384
2409
|
|
|
2385
2410
|
[^283]: Netlify/Decap CMS [#713](https://github.com/decaporg/decap-cms/issues/713)
|
|
2411
|
+
|
|
2412
|
+
[^284]: Netlify/Decap CMS [#7585](https://github.com/decaporg/decap-cms/issues/7585)
|