@sveltia/cms 0.82.1 → 0.84.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 +70 -22
- package/dist/sveltia-cms.js +252 -251
- package/dist/sveltia-cms.js.map +1 -1
- package/dist/sveltia-cms.mjs +255 -254
- package/dist/sveltia-cms.mjs.map +1 -1
- package/package.json +1 -1
- package/types/public.d.ts +41 -11
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
|
*/
|
|
@@ -1277,9 +1289,20 @@ export type CollectionMetaData = {
|
|
|
1277
1289
|
*/
|
|
1278
1290
|
export type CollectionIndexFile = {
|
|
1279
1291
|
/**
|
|
1280
|
-
* Index file name
|
|
1292
|
+
* Index file name without a locale or file extension. Default: `_index`,
|
|
1293
|
+
* which is used for Hugo’s special index file.
|
|
1281
1294
|
*/
|
|
1282
|
-
name
|
|
1295
|
+
name?: string;
|
|
1296
|
+
/**
|
|
1297
|
+
* Label to be displayed in the editor UI. Default: Index File or its
|
|
1298
|
+
* localized version.
|
|
1299
|
+
*/
|
|
1300
|
+
label?: string;
|
|
1301
|
+
/**
|
|
1302
|
+
* Name of a Material Symbols icon to be displayed in the editor UI.
|
|
1303
|
+
* Default: `home`.
|
|
1304
|
+
*/
|
|
1305
|
+
icon?: string;
|
|
1283
1306
|
/**
|
|
1284
1307
|
* Set of fields for the index file. If omitted, the regular entry
|
|
1285
1308
|
* collection `fields` will be used instead.
|
|
@@ -1455,7 +1478,8 @@ export type Collection = {
|
|
|
1455
1478
|
yaml_quote?: boolean;
|
|
1456
1479
|
/**
|
|
1457
1480
|
* A special option to make this collection a divider UI in the
|
|
1458
|
-
* collection list.
|
|
1481
|
+
* collection list. Default: `false`. If `true`, other options will be ignored, but you still have
|
|
1482
|
+
* to provide a unique `name`.
|
|
1459
1483
|
*/
|
|
1460
1484
|
divider?: boolean;
|
|
1461
1485
|
/**
|
|
@@ -1747,6 +1771,12 @@ export type SiteConfig = {
|
|
|
1747
1771
|
* Set of collections.
|
|
1748
1772
|
*/
|
|
1749
1773
|
collections: Collection[];
|
|
1774
|
+
/**
|
|
1775
|
+
* Set of singleton files, such as the site configuration
|
|
1776
|
+
* file or the homepage file. They are not part of any collection and can be accessed directly
|
|
1777
|
+
* through the collection list.
|
|
1778
|
+
*/
|
|
1779
|
+
singletons?: CollectionFile[];
|
|
1750
1780
|
/**
|
|
1751
1781
|
* Global i18n options.
|
|
1752
1782
|
*/
|