@sveltia/cms 0.53.6 → 0.54.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 CHANGED
@@ -59,6 +59,7 @@ The free, open source alternative to Netlify/Decap CMS is now in public beta, tu
59
59
  - [Using a custom icon for a collection](#using-a-custom-icon-for-a-collection)
60
60
  - [Adding dividers to the collection list](#adding-dividers-to-the-collection-list)
61
61
  - [Using a custom media folder for a collection](#using-a-custom-media-folder-for-a-collection)
62
+ - [Specifying default sort field and direction](#specifying-default-sort-field-and-direction)
62
63
  - [Using keyboard shortcuts](#using-keyboard-shortcuts)
63
64
  - [Using DeepL to translate entry fields](#using-deepl-to-translate-entry-fields)
64
65
  - [Localizing entry slugs](#localizing-entry-slugs)
@@ -81,7 +82,7 @@ The free, open source alternative to Netlify/Decap CMS is now in public beta, tu
81
82
 
82
83
  Sveltia CMS was born in November 2022, when the progress of Netlify CMS was stalled for more than six months. [@kyoshino](https://github.com/kyoshino)’s clients wanted to replace their Netlify CMS instances without much effort, mainly to get better internationalization (i18n) support.
83
84
 
84
- To achieve radical improvements in UX, performance, i18n and other areas, it was decided to build an alternative from the ground up, while ensuring an easy migration path from the other. After proving the concept with a rapid [Svelte](https://svelte.dev/) prototype, development was accelerated to address their primary use cases. The new product has since been named Sveltia CMS and released as open source software to encourage wider adoption.
85
+ To achieve radical improvements in UX, performance, i18n and other areas, it was ultimately decided to build an alternative from the ground up, while ensuring an easy migration path from the other. After proving the concept with a rapid [Svelte](https://svelte.dev/) prototype, development was accelerated to address their primary use cases. The new product has since been named Sveltia CMS and released as open source software to encourage wider adoption.
85
86
 
86
87
  We loved the concept of Netlify CMS — a single page app served from a CDN, plus a single YAML config file — and we wanted to revive it, modernize it, and take it to the next level.
87
88
 
@@ -114,7 +115,7 @@ While we fix reported bugs as quickly as possible, usually within 24 hours, our
114
115
  - Ensuring substantial [compatibility with Netlify/Decap CMS](#compatibility)
115
116
  - Providing partial [compatibility with Static CMS](#compatibility-with-static-cms)
116
117
  - Tackling as many [Netlify/Decap CMS issues](https://github.com/decaporg/decap-cms/issues) as possible
117
- - So far, 160+ of them, or 305+ including duplicates, have been effectively solved in Sveltia CMS
118
+ - So far, 160+ of them, or 310+ including duplicates, have been effectively solved in Sveltia CMS
118
119
  - Target: 300 or all relevant, fixable and worthwhile issues in the future; 500 including duplicates
119
120
  - Note: Issues include feature requests, bug reports, [“closed as stale” issues](https://github.com/decaporg/decap-cms/issues?q=is%3Aissue+%22Closing+as+stale%22) and [discussions](https://github.com/decaporg/decap-cms/discussions)
120
121
  - Many of their [top-voted features](https://github.com/decaporg/decap-cms/issues?q=is%3Aissue+is%3Aopen+sort%3Areactions-%2B1-desc) are on our table or already implemented in Sveltia CMS
@@ -123,7 +124,7 @@ While we fix reported bugs as quickly as possible, usually within 24 hours, our
123
124
  - Responding to requests from the maintainer’s clients
124
125
  - Making the code clean and maintainable
125
126
 
126
- ![300 Netlify/Decap CMS Issues Solved in Sveltia CMS (Including Duplicates)](https://raw.githubusercontent.com/sveltia/sveltia-cms/main/docs/headline-1-2025010304.webp)<br>
127
+ ![310 Netlify/Decap CMS Issues Solved in Sveltia CMS (Including Duplicates)](https://raw.githubusercontent.com/sveltia/sveltia-cms/main/docs/headline-1-20250117.webp)<br>
127
128
 
128
129
  ## Differentiators
129
130
 
@@ -135,21 +136,21 @@ We hope Netlify/Decap CMS users will be pleased and surprised by the hundreds of
135
136
  - The maintainer tries to be as responsive as possible. While there are no guarantees, the typical turnaround time for a bug fix is less than 24 hours.
136
137
  - Offers a modern, intuitive user interface, including an immersive dark mode[^2], inspired in part by the Netlify CMS v3 prototype[^1].
137
138
  - We develop [our own UI library](https://github.com/sveltia/sveltia-ui) to ensure optimal usability without compromising accessibility.
138
- - Comes with touch device support, such as larger buttons for easier tapping. While the UI is not yet optimized for small screens, it should work well with large tablets like iPad Pro or Pixel Tablet. Mobile support and other optimizations such as swipe navigation are planned shortly after the 1.0 release.
139
- - Made with Svelte, not React, means we can spend more time on UX rather than tedious state management. It also allows us to avoid common React application crashes[^113][^129]. Best of all, Svelte offers great performance.
139
+ - Comes with touch device support, such as larger buttons for easier tapping. While the UI is not yet optimized for small screens, it should work well with large tablets like iPad Pro or Pixel Tablet. Mobile support and other optimizations such as swipe navigation are planned after the 1.0 release.
140
+ - Made with [Svelte](https://svelte.dev/), not React, means we can spend more time on UX rather than tedious state management. It also allows us to avoid common React application crashes[^113][^129]. Best of all, Svelte offers great performance.
140
141
  - The in-app Help menu provides all links to useful resources, including release notes, feedback and support.
141
142
  - Users can personalize the application with various settings, including appearance and language. Developer Mode can also be enabled.
142
143
  - Never miss out on the latest features and bug fixes by being notified when an update to the CMS is available[^31]. Then update to the latest version with a single click[^66].
143
144
 
144
145
  ### Better performance
145
146
 
146
- - 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 any framework or static site generator (SSG) that can load static data files during the build process.
147
- - Small footprint: The bundle size is less than 500 KB when minified and [brotlied](https://en.wikipedia.org/wiki/Brotli), which is much lighter than Netlify CMS (1.5 MB), Decap CMS (1.7 MB) and Static CMS (2.6 MB)[^57][^64], even though we haven’t implemented some features yet, but rather added many new features. That’s the power of Svelte + Vite.
147
+ - Built completely from scratch with [Svelte](https://svelte.dev/) 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 any framework or static site generator (SSG) that can load static data files during the build process.
148
+ - Small footprint: The bundle size is less than 500 KB when minified and [brotlied](https://en.wikipedia.org/wiki/Brotli), which is much lighter than Netlify CMS (1.5 MB), Decap CMS (1.7 MB) and Static CMS (2.6 MB)[^57][^64], even though we haven’t implemented some features yet, but rather added many new features. That’s the power of Svelte + [Vite](https://vite.dev/).
148
149
  - We have upgraded from Svelte 4 to [Svelte 5](https://svelte.dev/blog/svelte-5-is-alive) to further improve performance, including an even smaller bundle size. A full migration to the Runes reactivity API is underway.
149
- - Sveltia CMS is free of technical debt (except for Moment.js, which will soon be replaced by Day.js) and [virtual DOM overhead](https://svelte.dev/blog/virtual-dom-is-pure-overhead).
150
+ - Sveltia CMS is free of technical debt (except for the Moment.js dependency, which will soon be replaced by Day.js) and [virtual DOM overhead](https://svelte.dev/blog/virtual-dom-is-pure-overhead).
150
151
  - 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] (the useless `search` configuration option is ignored). It also avoids the slowness and potential API rate limit violations caused by hundreds of requests with Relation widgets[^14].
151
152
  - 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/).
152
- - Our [local repository workflow](#working-with-a-local-git-repository) utilizes the modern File System Access API to read and write files natively through the web browser, rather than using a slow, ad hoc REST API through a proxy server.
153
+ - Our [local repository workflow](#working-with-a-local-git-repository) utilizes the modern [File System Access API](https://developer.chrome.com/articles/file-system-access/) to read and write files natively through the web browser, rather than using a slow, ad hoc REST API through a proxy server.
153
154
  - Sorting, filtering and grouping of entries is done instantly without reloading the entire content.
154
155
  - Uses caching, lazy loading and infinite scrolling techniques. A list of repository files is stored locally for faster startup and bandwidth savings.
155
156
  - Thumbnails of assets, including videos and PDF files, are generated and cached for faster rendering of the Asset Library and other parts of the CMS[^39].
@@ -212,7 +213,7 @@ We hope Netlify/Decap CMS users will be pleased and surprised by the hundreds of
212
213
 
213
214
  ### Better i18n support
214
215
 
215
- Sveltia CMS has been built with a multilingual architecture from the very beginning. You can expect best-in-class internationalization (i18n) support, as it’s required by clients of maintainer [@kyoshino](https://github.com/kyoshino), who himself was a long-time Japanese localizer for Mozilla and currently lives in a [multicultural city](https://en.wikipedia.org/wiki/Toronto) where 150+ languages are spoken.
216
+ Sveltia CMS has been built with a multilingual architecture from the very beginning. You can expect best-in-class internationalization (i18n) support, as it’s required by clients of maintainer [@kyoshino](https://github.com/kyoshino), who himself was a long-time Japanese localizer for [Mozilla](https://www.mozilla.org/) and currently lives in [one of the most multicultural cities in the world](https://en.wikipedia.org/wiki/Toronto) where 150+ languages are spoken.
216
217
 
217
218
  - Configuration
218
219
  - The [i18n limitations](https://decapcms.org/docs/i18n/#limitations) in Netlify/Decap CMS do not apply to Sveltia CMS:
@@ -248,7 +249,11 @@ Sveltia CMS has been built with a multilingual architecture from the very beginn
248
249
  - Provides some new options, including:
249
250
  - `icon`: [Choose a custom icon for each collection](#using-a-custom-icon-for-a-collection)[^3].
250
251
  - `divider`: [Add dividers to the collection list](#adding-dividers-to-the-collection-list).
251
- - `thumbnail`: Specify the field name for a thumbnail displayed on the entry list, like `thumbnail: featuredImage`[^130]. A nested field can be specified using dot notation, e.g. `images.0.src`. If undefined, the `name` of the first image field is used.
252
+ - `thumbnail`: Specify the field name for a thumbnail displayed on the entry list, like `thumbnail: featuredImage`[^130].
253
+ - A nested field can be specified using dot notation, e.g. `heroImage.src`.
254
+ - A wildcard in the field name is also supported, e.g. `images.*.src`.
255
+ - Multiple field names can be specified as an array for fallback purpose, e.g. `[thumbnail, cover]`.
256
+ - If this option is omitted, any non-nested, non-empty Image or File field will be used[^173].
252
257
  - Enhancements to the entry `filter` option for folder collections:
253
258
  - Boolean `value` works as expected[^93].
254
259
  - `value` accepts `null` to match an undefined field value.
@@ -273,6 +278,7 @@ Sveltia CMS has been built with a multilingual architecture from the very beginn
273
278
  - Setting the collection `path` doesn’t affect the entry slugs stored with the Relation widget[^137].
274
279
  - Entry slugs are [localizable](#localizing-entry-slugs)[^80].
275
280
  - Entry listing
281
+ - [Default sort field and direction](#specifying-default-entry-sort-field-and-direction) can be specified[^172].
276
282
  - Sorting entries by a DateTime field works as expected[^110].
277
283
  - Entry grouping and sorting can work together. For example, it’s possible to group by year and then sort by year if configured properly.
278
284
  - Hugo’s special `_index.md` files, including localized ones like `_index.en.md`, are ignored in folder collections unless the `path` option is configured to end with `_index` and the `extension` is `md`[^120]. You can still manage these files as part of a file collection if necessary.
@@ -356,6 +362,7 @@ Sveltia CMS has been built with a multilingual architecture from the very beginn
356
362
  - The default editor mode can be set 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.
357
363
  - 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.
358
364
  - The built-in `image` component can be inserted with a single click.
365
+ - The built-in `image` component allows users to add, edit or remove a link set on an image[^171].
359
366
  - 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.
360
367
  - Code in a code block in the editor can be copied as expected[^165].
361
368
  - Line breaks are rendered as line breaks in the Preview pane according to GitHub Flavored Markdown (GFM).
@@ -420,7 +427,7 @@ Sveltia CMS has been built with a multilingual architecture from the very beginn
420
427
  ### Better asset management
421
428
 
422
429
  - A completely new, full-fledged Asset Library, built separately from the image selection dialog, makes it easy to manage all of your files, including images, videos and documents[^96].
423
- - Navigate between the global media folder and collection media folders[^6].
430
+ - Navigate between the global media folder and [collection media folders](#using-a-custom-media-folder-for-a-collection)[^6].
424
431
  - Preview image, audio, video, text and PDF files. Check your site’s [CSP](#setting-up-content-security-policy) if the preview doesn’t work.
425
432
  - Copy the public URL[^74], file path, text data or image data of a selected asset to clipboard. The file path starts with `/` as expected[^48].
426
433
  - Edit plain text assets, including SVG images.
@@ -505,7 +512,7 @@ We plan to provide partial compatibility with [Static CMS](https://github.com/St
505
512
 
506
513
  - Configuration options
507
514
  - Static CMS made [some breaking changes](https://staticjscms.netlify.app/docs/decap-migration-guide) to sortable fields, view filters/groups, List widget, etc. while Sveltia CMS follows Netlify/Decap CMS, so you should review your configuration carefully.
508
- - The `default` option for sortable fields will be implemented in Sveltia CMS soon. ([#304](https://github.com/sveltia/sveltia-cms/issues/304))
515
+ - The `default` option for sortable fields is [implemented in Sveltia CMS](#specifying-default-sort-field-and-direction).
509
516
  - Directory navigation in the Asset Library is partially supported in Sveltia CMS. If you define [collection-specific `media_folder`s](#using-a-custom-media-folder-for-a-collection), these folders will be displayed in the Asset Library and Select File/Image dialog. Display of subfolders within a configured folder will be implemented soon. We don’t plan to support the `folder_support` and `display_in_navigation` options for `media_library`; subfolders will be displayed with no configuration. ([#301](https://github.com/sveltia/sveltia-cms/issues/301))
510
517
  - The `logo_link` global option will not be supported. Use `display_url` or `site_url` instead.
511
518
  - The `yaml` global option will not be supported, as Sveltia CMS doesn’t expose the `yaml` library options directly for forward compatibility reasons. However, we do have some [data output options](#controlling-data-output), including YAML indentation and quotes.
@@ -705,6 +712,24 @@ Rather, if you’d like to add all the media files for a collection in one singl
705
712
 
706
713
  In Sveltia CMS, those collection media folders are displayed prominently for easier asset management. We recommend setting `media_folder` and `public_folder` for each collection if it contains one or more File/Image fields.
707
714
 
715
+ ### Specifying default sort field and direction
716
+
717
+ Sveltia CMS has extended the `sortable_fields` collection option to allow developers to define the field name and direction to be used for sorting entries by default. Our implementation is compatible with Static CMS. This is especially useful if you want to sort entries by date from new to old:
718
+
719
+ ```yaml
720
+ collections:
721
+ - name: posts
722
+ sortable_fields:
723
+ fields: ['title', 'published_date', 'author']
724
+ default:
725
+ field: published_date
726
+ direction: descending # or ascending
727
+ ```
728
+
729
+ For backward compatibility with [Netlify/Decap CMS](https://decapcms.org/docs/configuration-options/#sortable_fields), `sortable_fields` with a field list (an array) will continue to work.
730
+
731
+ For backward compatibility with [Static CMS](https://staticjscms.netlify.app/docs/collection-overview#sortable-fields), the `direction` option accepts title case values: `Ascending` and `Descending`. However, `None` is not supported and has the same effect as `ascending`.
732
+
708
733
  ### Using keyboard shortcuts
709
734
 
710
735
  - View the Content Library: `Alt+1`
@@ -1396,3 +1421,9 @@ This software is provided “as is” without any express or implied warranty. W
1396
1421
  [^169]: Netlify/Decap CMS [#7364](https://github.com/decaporg/decap-cms/issues/7364)
1397
1422
 
1398
1423
  [^170]: Netlify/Decap CMS [#7371](https://github.com/decaporg/decap-cms/issues/7371)
1424
+
1425
+ [^171]: Netlify/Decap CMS [#4754](https://github.com/decaporg/decap-cms/issues/4754)
1426
+
1427
+ [^172]: Netlify/Decap CMS [#3715](https://github.com/decaporg/decap-cms/issues/3715)
1428
+
1429
+ [^173]: Netlify/Decap CMS [#3715](https://github.com/decaporg/decap-cms/issues/5317)