@sveltia/cms 0.82.0 → 0.83.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 +102 -22
- package/dist/sveltia-cms.js +261 -260
- package/dist/sveltia-cms.js.map +1 -1
- package/dist/sveltia-cms.mjs +262 -261
- package/dist/sveltia-cms.mjs.map +1 -1
- package/package.json +1 -1
- package/types/public.d.ts +28 -9
package/package.json
CHANGED
package/types/public.d.ts
CHANGED
|
@@ -873,12 +873,13 @@ export type RelationFieldProps = {
|
|
|
873
873
|
*/
|
|
874
874
|
default?: any | any[];
|
|
875
875
|
/**
|
|
876
|
-
* Referenced collection name.
|
|
876
|
+
* Referenced collection name. Use `_singletons` for the singleton
|
|
877
|
+
* collection.
|
|
877
878
|
*/
|
|
878
879
|
collection: string;
|
|
879
880
|
/**
|
|
880
|
-
* Referenced file identifier for a file collection. Required if
|
|
881
|
-
* `collection` is
|
|
881
|
+
* Referenced file identifier for a file/singleton collection. Required if
|
|
882
|
+
* the `collection` is defined.
|
|
882
883
|
*/
|
|
883
884
|
file?: string;
|
|
884
885
|
/**
|
|
@@ -1029,8 +1030,8 @@ export type I18nFileStructure = "single_file" | "multiple_files" | "multiple_fol
|
|
|
1029
1030
|
*/
|
|
1030
1031
|
export type I18nOptions = {
|
|
1031
1032
|
/**
|
|
1032
|
-
* File structure for entry collections. File
|
|
1033
|
-
* must define the structure using `{{locale}}` in the `file` option.
|
|
1033
|
+
* File structure for entry collections. File/singleton
|
|
1034
|
+
* collection must define the structure using `{{locale}}` in the `file` option.
|
|
1034
1035
|
*/
|
|
1035
1036
|
structure: I18nFileStructure;
|
|
1036
1037
|
/**
|
|
@@ -1069,14 +1070,14 @@ export type I18nOptions = {
|
|
|
1069
1070
|
/**
|
|
1070
1071
|
* Whether to exclude the default locale
|
|
1071
1072
|
* from entry filenames. Default: `false`. This option applies to entry collections with the
|
|
1072
|
-
* `multiple_files` i18n structure enabled, as well as to file collection items with the
|
|
1073
|
-
* ending with `.{{locale}}.<extension>`, aiming to support Zola’s multilingual sites:
|
|
1073
|
+
* `multiple_files` i18n structure enabled, as well as to file/singleton collection items with the
|
|
1074
|
+
* `file` path ending with `.{{locale}}.<extension>`, aiming to support Zola’s multilingual sites:
|
|
1074
1075
|
* https://www.getzola.org/documentation/content/multilingual/.
|
|
1075
1076
|
*/
|
|
1076
1077
|
omit_default_locale_from_filename?: boolean;
|
|
1077
1078
|
};
|
|
1078
1079
|
/**
|
|
1079
|
-
* Single file in a file collection.
|
|
1080
|
+
* Single file in a file/singleton collection.
|
|
1080
1081
|
*/
|
|
1081
1082
|
export type CollectionFile = {
|
|
1082
1083
|
/**
|
|
@@ -1087,6 +1088,11 @@ export type CollectionFile = {
|
|
|
1087
1088
|
* Label to be displayed in the editor UI. Default: `name` option value.
|
|
1088
1089
|
*/
|
|
1089
1090
|
label?: string;
|
|
1091
|
+
/**
|
|
1092
|
+
* Name of a Material Symbols icon to be displayed in the collection file
|
|
1093
|
+
* list and other places.
|
|
1094
|
+
*/
|
|
1095
|
+
icon?: string;
|
|
1090
1096
|
/**
|
|
1091
1097
|
* File path relative to the project root.
|
|
1092
1098
|
*/
|
|
@@ -1121,6 +1127,12 @@ export type CollectionFile = {
|
|
|
1121
1127
|
* I18n options. Default: `false`.
|
|
1122
1128
|
*/
|
|
1123
1129
|
i18n?: I18nOptions | boolean;
|
|
1130
|
+
/**
|
|
1131
|
+
* A special option to make this file a divider UI in the singleton
|
|
1132
|
+
* file list. Default: `false`. Not supported in a file collection. If `true`, other options will be
|
|
1133
|
+
* ignored, but you still have to provide a unique `name`.
|
|
1134
|
+
*/
|
|
1135
|
+
divider?: boolean;
|
|
1124
1136
|
/**
|
|
1125
1137
|
* Preview URL path template.
|
|
1126
1138
|
*/
|
|
@@ -1455,7 +1467,8 @@ export type Collection = {
|
|
|
1455
1467
|
yaml_quote?: boolean;
|
|
1456
1468
|
/**
|
|
1457
1469
|
* A special option to make this collection a divider UI in the
|
|
1458
|
-
* collection list.
|
|
1470
|
+
* collection list. Default: `false`. If `true`, other options will be ignored, but you still have
|
|
1471
|
+
* to provide a unique `name`.
|
|
1459
1472
|
*/
|
|
1460
1473
|
divider?: boolean;
|
|
1461
1474
|
/**
|
|
@@ -1747,6 +1760,12 @@ export type SiteConfig = {
|
|
|
1747
1760
|
* Set of collections.
|
|
1748
1761
|
*/
|
|
1749
1762
|
collections: Collection[];
|
|
1763
|
+
/**
|
|
1764
|
+
* Set of singleton files, such as the site configuration
|
|
1765
|
+
* file or the homepage file. They are not part of any collection and can be accessed directly
|
|
1766
|
+
* through the collection list.
|
|
1767
|
+
*/
|
|
1768
|
+
singletons?: CollectionFile[];
|
|
1750
1769
|
/**
|
|
1751
1770
|
* Global i18n options.
|
|
1752
1771
|
*/
|