@cloudcannon/configuration-types 0.0.37 → 0.0.39

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.
Files changed (44) hide show
  1. package/dist/cloudcannon-config.latest.schema.json +9336 -10956
  2. package/dist/cloudcannon-config.legacy-eleventy.schema.json +9442 -11056
  3. package/dist/cloudcannon-config.legacy-hugo.schema.json +9412 -11031
  4. package/dist/cloudcannon-config.legacy-jekyll.schema.json +9442 -11056
  5. package/dist/cloudcannon-config.legacy-reader.schema.json +5865 -7487
  6. package/package.json +19 -21
  7. package/src/build-coupled.ts +295 -0
  8. package/src/cascade.ts +38 -0
  9. package/src/configuration.ts +426 -0
  10. package/src/documentation.ts +22 -0
  11. package/src/editables.ts +243 -0
  12. package/src/icon.ts +3597 -0
  13. package/src/image-options.ts +72 -0
  14. package/src/index.ts +40 -0
  15. package/src/inputs.ts +993 -0
  16. package/src/markdown.ts +97 -0
  17. package/src/mimetype.ts +445 -0
  18. package/src/paths.ts +43 -0
  19. package/src/preview.ts +125 -0
  20. package/src/select-values.ts +26 -0
  21. package/src/snippets.ts +113 -0
  22. package/src/source-editor.ts +68 -0
  23. package/src/structures.ts +120 -0
  24. package/src/syntax.ts +183 -0
  25. package/src/timezone.ts +607 -0
  26. package/src/build-coupled.d.ts +0 -315
  27. package/src/cascade.d.ts +0 -37
  28. package/src/cloudcannon-config.schema.json +0 -79
  29. package/src/configuration.d.ts +0 -750
  30. package/src/documentation.d.ts +0 -18
  31. package/src/editables.d.ts +0 -252
  32. package/src/icon.d.ts +0 -3585
  33. package/src/image-resizeable.d.ts +0 -65
  34. package/src/index.d.ts +0 -36
  35. package/src/inputs.d.ts +0 -1647
  36. package/src/javascript-api.d.ts +0 -204
  37. package/src/markdown.d.ts +0 -103
  38. package/src/paths.d.ts +0 -44
  39. package/src/preview.d.ts +0 -110
  40. package/src/select-values.d.ts +0 -6
  41. package/src/snippets.d.ts +0 -227
  42. package/src/source-editor.d.ts +0 -92
  43. package/src/structures.d.ts +0 -113
  44. package/src/timezone.d.ts +0 -596
@@ -1,750 +0,0 @@
1
- import type { Cascade, EditorKey, ReducedCascade } from './cascade';
2
- import type { Documentation } from './documentation';
3
- import type { Icon } from './icon';
4
- import type { Input } from './inputs';
5
- import type { MarkdownSettings } from './markdown';
6
- import type { WithPaths } from './paths';
7
- import type { WithPreview } from './preview';
8
- import type { SnippetConfig, SnippetsImports } from './snippets';
9
- import type { SourceEditor } from './source-editor';
10
- import type { StructureBase } from './structures';
11
- import type { Timezone } from './timezone';
12
-
13
- export type HrefAddOption = {
14
- /**
15
- * The text displayed for the menu item.
16
- */
17
- name?: string;
18
- /**
19
- * The icon next to the text in the menu item.
20
- *
21
- * @default add
22
- */
23
- icon?: Icon;
24
- /**
25
- * The link that opens when the option is clicked. Can either be an external or internal link. If
26
- * internal, the link is relative to the current site.
27
- */
28
- href: string;
29
- };
30
-
31
- export type AddOption = {
32
- /**
33
- * The text displayed for the menu item. Defaults to using name from the matching schema if set.
34
- */
35
- name?: string;
36
- /**
37
- * The icon next to the text in the menu item. Defaults to using icon from the matching schema if
38
- * set, then falls back to add.
39
- */
40
- icon?: Icon;
41
- /**
42
- * The editor to open the new file in. Defaults to an appropriate editor for new file's type if
43
- * possible. If no default editor can be calculated, or the editor does not support the new file
44
- * type, a warning is shown in place of the editor.
45
- */
46
- editor?: EditorKey;
47
- /**
48
- * Enforces a path for new files to be created in, regardless of path the user is currently
49
- * navigated to within the collection file list. Relative to the path of the collection defined in
50
- * collection. Defaults to the path within the collection the user is currently navigated to.
51
- */
52
- base_path?: string;
53
- /**
54
- * Sets which collection this action is creating a file in. This is used when matching the value
55
- * for schema. Defaults to the containing collection these `add_options` are configured in.
56
- */
57
- collection?: string;
58
- /**
59
- * The schema that new files are created from with this action. This schema is not restricted to
60
- * the containing collection, and is instead relative to the collection specified with collection.
61
- * Defaults to default if schemas are configured for the collection.
62
- */
63
- schema?: string;
64
- /**
65
- * The path to a file used to populate the initial contents of a new file if no schemas are
66
- * configured. We recommend using schemas, and this is ignored if a schema is available.
67
- */
68
- default_content_file?: string;
69
- };
70
-
71
- export interface Schema extends Cascade, WithPreview, StructureBase {
72
- /**
73
- * The path to the schema file. Relative to the root folder of the site.
74
- */
75
- path: string;
76
- /**
77
- * Displayed in the add menu when creating new files. Defaults to a formatted version of the key.
78
- */
79
- name?: string;
80
- /**
81
- * Displayed in the add menu when creating new files; also used as the icon for collection files
82
- * if no other preview is found. Defaults to notes.
83
- *
84
- * @default notes
85
- */
86
- icon?: Icon;
87
- /**
88
- * Controls where new files are saved.
89
- */
90
- create?: Create;
91
- /**
92
- * Preview your unbuilt pages (e.g. drafts) to another page's output URL. The Visual Editor will
93
- * load that URL, where Data Bindings and Previews are available to render your new page without
94
- * saving.
95
- */
96
- new_preview_url?: string;
97
- }
98
-
99
- export type SortOrder = 'ascending' | 'descending' | 'asc' | 'desc';
100
-
101
- export interface Sort {
102
- /**
103
- * Defines what field contains the value to sort on inside each collection item's data.
104
- */
105
- key: string;
106
- /**
107
- * Controls which sort values come first.
108
- *
109
- * @default ascending
110
- */
111
- order?: SortOrder;
112
- }
113
-
114
- export interface SortOption extends Sort {
115
- /**
116
- * The text to display in the sort option list. Defaults to a generated label from key and order.
117
- */
118
- label?: string;
119
- }
120
-
121
- export interface Create extends ReducedCascade {
122
- /**
123
- * The raw template to be processed when creating files. Relative to the containing collection's
124
- * path.
125
- */
126
- path?: string;
127
- /**
128
- * Adds to the available data placeholders coming from the file. Entry values follow the same
129
- * format as path, and are processed sequentially before path. These values are not saved back to
130
- * your file.
131
- */
132
- extra_data?: Record<string, string>;
133
- /**
134
- * Defines a target collection when publishing. When a file is published, the target collection's
135
- * create definition is used instead.
136
- */
137
- publish_to?: string;
138
- }
139
-
140
- export interface CollectionConfig extends Cascade, WithPreview {
141
- /**
142
- * This key defines the folder path for the collection key in which it is nested.
143
- *
144
- * The value for this key is relative to your Site `source`. Each Collection must have a unique
145
- * path.
146
- *
147
- * This key has no default.
148
- *
149
- * https://cloudcannon.com/documentation/articles/collections-reference/#path
150
- */
151
- path: string;
152
- /**
153
- * This key defines globs which filter the files visible in the _Collection browser_ for a given
154
- * Collection. Values in this array are relative to the Collection `path`.
155
- *
156
- * Globs can be positive (e.g. `*.yml`), or negative (e.g. `!**\/*.json`). Files are included in a
157
- * Collection if they match any positive globs and do not match any negative globs. If you do not
158
- * define any positive globs, CloudCannon will include all non-developer files in a Collection
159
- * unless they match a negative glob.
160
- *
161
- * For more information about developer files, please read our documentation on the
162
- * [`include_developer_files`](https://cloudcannon.com/documentation/articles/collections-reference/#include_developer_files)
163
- * key.
164
- *
165
- * Defining a negative glob for a Collection does not remove a file from the associated Collection
166
- * folder in your Git repository. Similarly, defining a positive glob for a file in a folder
167
- * outside your Collection path does not move the file.
168
- *
169
- * This key has no default.
170
- *
171
- * https://cloudcannon.com/documentation/articles/collections-reference/#glob
172
- */
173
- glob?: string[] | string;
174
- /**
175
- * This key defines the output URL for files in a given Collection. CloudCannon uses the output
176
- * URL in the Visual Editor, and when linking to your Testing Domain and Custom Domain.
177
- *
178
- * Values for this key can be a mix of plain text and template strings, and should begin with the
179
- * `/` character. Template strings can contain data placeholders and fixed placeholders, which
180
- * CloudCannon will replace with the data it references when generating the output URL.
181
- *
182
- * For more information about data placeholders and fixed placeholders, please read our
183
- * documentation on [configuring your template
184
- * strings](https://cloudcannon.com/documentation/articles/configure-your-template-strings/).
185
- *
186
- * This key has no default.
187
- *
188
- * https://cloudcannon.com/documentation/articles/collections-reference/#url
189
- */
190
- url?: string;
191
- /**
192
- * This key toggles whether CloudCannon will generate an output URL for a given Collection.
193
- *
194
- * Setting this key to `true` will prevent CloudCannon from generating an output URL for a
195
- * Collection.
196
- *
197
- * By default, this key is `false` (i.e., generate an output URL for this Collection).
198
- *
199
- * https://cloudcannon.com/documentation/articles/collections-reference/#disable_url
200
- *
201
- * @default false
202
- */
203
- disable_url?: boolean;
204
- /**
205
- * This key toggles whether CloudCannon removes developer files from your _Collection browser_.
206
- * CloudCannon excludes files that probably shouldn't be edited in a CMS from your _Collection
207
- * browser_, for example files like `README.md` or `package.json`. CloudCannon excludes these
208
- * files even if you have configured globs to allow them.
209
- *
210
- * Setting this key to `true` will allow CloudCannon to show developer files, assuming they are
211
- * not filtered out by any configured globs.
212
- *
213
- * By default, this key is `false` (i.e., do not include developer files).
214
- *
215
- * https://cloudcannon.com/documentation/articles/collections-reference/#include_developer_files
216
- *
217
- * @default false
218
- */
219
- include_developer_files?: boolean;
220
- /**
221
- * This key defines the display name for a Collection. The name appears in the _Site Navigation_
222
- * and at the top of the _Collection browser_. Changing the display name does not affect the
223
- * Collection key name.
224
- *
225
- * By default, CloudCannon uses the Collection key name in title case (i.e., `blog_files` becomes
226
- * "Blog Files").
227
- *
228
- * https://cloudcannon.com/documentation/articles/collections-reference/#name
229
- */
230
- name?: string;
231
- /**
232
- * This key defines the description text that appears on the _Collection browser_ page. Collection
233
- * descriptions are useful for adding extra context for your team members.
234
- *
235
- * CloudCannon supports a limited selection of Markdown formatting for the value of this key:
236
- * links, bold, italic, subscript, superscript, and inline code.
237
- *
238
- * This key has no default.
239
- *
240
- * https://cloudcannon.com/documentation/articles/collections-reference/#description
241
- */
242
- description?: string;
243
- /**
244
- * This key defines the icon for a Collection. Collection icons appear in the _Site Navigation_
245
- * and are the default icon for Collection file Cards if you have not defined `preview.icon`.
246
- *
247
- * For more information about the preview icon, please read our documentation on the
248
- * [`preview`](https://cloudcannon.com/documentation/articles/configure-your-card-previews/) key.
249
- *
250
- * Values are from [Google's Material
251
- * Symbols](https://fonts.google.com/icons?icon.set=Material+Symbols&icon.style=Rounded).
252
- *
253
- * By default, CloudCannon uses `notes` with some exceptions (e.g., `data_usage` for the `data`
254
- * Collection).
255
- *
256
- * https://cloudcannon.com/documentation/articles/collections-reference/#icon
257
- *
258
- * @default notes
259
- */
260
- icon?: Icon;
261
- /**
262
- * This key defines the documentation link at the top of a _Collection browser_. Collection
263
- * documentation is useful for assisting your team members.
264
- *
265
- * The following nested keys are available:
266
- *
267
- * - `url` (required)
268
- * - `text`
269
- * - `icon`
270
- *
271
- * This key has no default.
272
- *
273
- * # Examples
274
- *
275
- * In this example, the documentation link for the `data` Collection goes to CloudCannon
276
- * Documentation.
277
- *
278
- * ```yaml
279
- * collections_config:
280
- * data:
281
- * documentation:
282
- * url: https://cloudcannon.com/documentation/
283
- * text: CloudCannon Documentation
284
- * icon: star
285
- * ```
286
- *
287
- * https://cloudcannon.com/documentation/articles/collections-reference/#documentation
288
- */
289
- documentation?: Documentation;
290
- /**
291
- * This key defines how CloudCannon sorts your Collection files when you first open your
292
- * _Collection browser_. Configuring this key allows you to sort your Collection using a
293
- * structured data key in your files.
294
- *
295
- * The following nested keys are available:
296
- *
297
- * - `key` (required)
298
- * - `order`
299
- *
300
- * By default, CloudCannon sorts your Collection files alphabetically by filename in ascending
301
- * order by default. However, if you have configured the
302
- * [`sort_options`](https://cloudcannon.com/documentation/articles/collections-reference/#sort_options)
303
- * key, CloudCannon will use the first array item in `sort_options`.
304
- *
305
- * If you use the _Sort_ dropdown in your _Collection browser_ to order your Collection files,
306
- * CloudCannon will preferentially use your most recent sorting method over the value configured
307
- * in the `sort` key.
308
- *
309
- * https://cloudcannon.com/documentation/articles/collections-reference/#sort
310
- */
311
- sort?: Sort;
312
- /**
313
- * This key defines the options for the Sort dropdown in a _Collection browser_. Configuring sort
314
- * options for a Collection will remove CloudCannon's default sorting options from the _Sort_
315
- * dropdown.
316
- *
317
- * The following nested keys are available for each entry in the `sort_options` array:
318
- *
319
- * - `key` (required)
320
- * - `order`
321
- * - `label`
322
- *
323
- * By default, CloudCannon provides sorting options for path, file size, file creation time, and
324
- * last modified, in ascending and descending order. CloudCannon will also read data keys from
325
- * your early Collection files and provide options to sort by those key values.
326
- *
327
- * https://cloudcannon.com/documentation/articles/collections-reference/#sort_options
328
- */
329
- sort_options?: SortOption[];
330
- /**
331
- * This key defines the singular noun for your Collection name. CloudCannon uses the singular noun
332
- * in the _+ Add_ button in the top right of the _Collection browser_ when you select the option
333
- * to add a new file. This is useful if your Collection name is an irregular plural (e.g.,
334
- * "syllabi" or "syllabuses" to "syllabus").
335
- *
336
- * By default, CloudCannon creates a singular noun from the key, usually by removing the `s`
337
- * character (e.g., "posts" to "post").
338
- *
339
- * This key has no default.
340
- *
341
- * https://cloudcannon.com/documentation/articles/collections-reference/#singular_name
342
- */
343
- singular_name?: string;
344
- /**
345
- * This key defines the options available in the _+ Add_ button dropdown at the top right of your
346
- * _Collection browser_. Configuring add options for a Collection will remove CloudCannon's
347
- * default "Add a file" option from the _+ Add_ button dropdown.
348
- *
349
- * The following nested keys are available for each standard entry in `add_options`:
350
- *
351
- * - `name`
352
- * - `icon`
353
- * - `editor`
354
- * - `base_path`
355
- * - `collection`
356
- * - `schema`
357
- * - `default_content_file`
358
- *
359
- * The following nested keys are available for each URL entry in `add_options`:
360
- *
361
- * - `name`
362
- * - `icon`
363
- * - `href`
364
- *
365
- * By default, CloudCannon adds the "Add a file" and "Create new folder" options to the _+ Add_
366
- * dropdown. Additionally, any Schemas you have configured for a Collection will also appear in
367
- * the _+ Add_ dropdown. For more information on these options, please read our reference
368
- * documentation on
369
- * [`disable_add`](https://cloudcannon.com/documentation/articles/collections-reference/#disable_add),
370
- * [`disable_add_folder`](https://cloudcannon.com/documentation/articles/collections-reference/#disable_add_folder),
371
- * and [`schemas`](https://cloudcannon.com/documentation/articles/schemas-reference/#schemas).
372
- *
373
- * # Examples
374
- *
375
- * In this example, we want team members in the `_posts` Collection to create new files in the
376
- * `blog` subfolder of the `_drafts` Collection. CloudCannon will open these files in the [Content
377
- * Editor](https://cloudcannon.com/documentation/articles/the-content-editor/).
378
- *
379
- * ```yaml
380
- * collections_config:
381
- * _posts:
382
- * add_options:
383
- * - name: Add draft blog
384
- * icon: post_add
385
- * editor: content
386
- * base_path: /../_drafts/blog
387
- * ```
388
- *
389
- * In this example, the _+ Add_ button dropdown in the team _Collection browser_ has a link to the
390
- * Office Locations page on our live website.
391
- *
392
- * ```yaml
393
- * collections_config:
394
- * team:
395
- * add_options:
396
- * - name: Office Locations
397
- * icon: map
398
- * href: /our-offices
399
- * ```
400
- *
401
- * https://cloudcannon.com/documentation/articles/collections-reference/#add_options
402
- */
403
- add_options?: (AddOption | HrefAddOption)[];
404
- /**
405
- * This key defines the path to which CloudCannon will save new files in a Collection. CloudCannon
406
- * generates "Create Paths" when you open the _Review changes_ modal.
407
- *
408
- * The following nested keys are available:
409
- *
410
- * - `path` (required)
411
- * - `extra_data`
412
- * - `publish_to`
413
- * - `_inputs`
414
- * - `_select_data`
415
- * - `_structures`
416
- *
417
- * This key has no default.
418
- *
419
- * For more information, please read our documentation on [Create
420
- * Paths](https://cloudcannon.com/documentation/articles/set-the-path-for-new-files/).
421
- *
422
- * # Examples
423
- *
424
- * In this example, CloudCannon will generate a Create Path for new files in the `blog` Collection
425
- * using the `date` and `title` structured data keys. For example, CloudCannon will generate a
426
- * create path of `blog/2024-10-31-spooky-getaway.md` for a file with the date 31st October 2024
427
- * and the title "Spooky Getaway".
428
- *
429
- * ```yaml
430
- * collections_config:
431
- * blog:
432
- * create:
433
- * extra_data:
434
- * filename: '{date|year}-{date|month}-{date|day}-{title}'
435
- * path: '[relative_base_path]/{filename|slugify}.[ext]'
436
- * ```
437
- *
438
- * https://cloudcannon.com/documentation/articles/collections-reference/#create
439
- */
440
- create?: Create;
441
- /**
442
- * This key toggles whether team members can use the _+ Add_ button in the top right of the
443
- * _Collection browser_ to add files to a Collection. This key does not affect your ability to add
444
- * files using the _File browser_.
445
- *
446
- * Setting this key to `true` will prevent team members from adding new files through the
447
- * _Collection browser_.
448
- *
449
- * By default, this key is `false` (i.e., team members can add to the Collection) for most SSGs.
450
- * For Eleventy, Hugo, and Jekyll, this key defaults to `true` for the data Collection (all
451
- * subfolders in the `data` folder are non-output Collections).
452
- *
453
- * If both `disable_add` and `disable_add_folder` are set to `true`, and you have not defined any
454
- * other `add_options`, then the _+ Add_ button will not appear in the top right of the
455
- * _Collection browser_.
456
- *
457
- * https://cloudcannon.com/documentation/articles/collections-reference/#disable_add
458
- */
459
- disable_add?: boolean;
460
- /**
461
- * This key toggles whether team members can use the _+ Add_ button in the top right of the
462
- * _Collection browser_ to add subfolders to a Collection. This key does not affect your ability
463
- * to add subfolders using the _File browser_.
464
- *
465
- * Setting this key to `true` will prevent team members from adding new subfolders through the
466
- * _Collection browser_.
467
- *
468
- * By default, this key is `false` (i.e., team members can add folders to the Collection) for most
469
- * SSGs. For Eleventy, Hugo, and Jekyll, this key defaults to `true` for the `data` Collection
470
- * (all subfolders in the `data` folder are non-output Collections).
471
- *
472
- * If both `disable_add` and `disable_add_folder` are set to `true`, and you have not defined any
473
- * other `add_options`, then the _+ Add_ button will not appear in the top right of the
474
- * _Collection browser_.
475
- *
476
- * https://cloudcannon.com/documentation/articles/collections-reference/#disable_add_folder
477
- */
478
- disable_add_folder?: boolean;
479
- /**
480
- * This key toggles whether team members can use the _+ Add_ button in the top right of the
481
- * _Collection browser_ to add files to a Collection. This key does not affect your ability to add
482
- * files using the _File browser_.
483
- *
484
- * Setting this key to `true` will prevent team members from adding new files through the
485
- * _Collection browser_.
486
- *
487
- * By default, this key is `false` (i.e., team members can add to the Collection) for most SSGs.
488
- * For Eleventy, Hugo, and Jekyll, this key defaults to `true` for the `data` Collection (all
489
- * subfolders in the `data` folder are non-output Collections).
490
- *
491
- * If both `disable_add` and `disable_add_folder` are set to `true`, and you have not defined any
492
- * other `add_options`, then the _+ Add_ button will not appear in the top right of the
493
- * _Collection browser_.
494
- *
495
- * https://cloudcannon.com/documentation/articles/collections-reference/#disable_file_actions
496
- */
497
- disable_file_actions?: boolean;
498
- /**
499
- * This key defines a new URL for previewing your unbuilt pages in the [Visual
500
- * Editor](https://cloudcannon.com/documentation/articles/the-visual-editor/). The Visual Editor
501
- * will load the new preview URL and use Data Bindings and Previews to render your page without
502
- * saving or building.
503
- *
504
- * This key does not affect the URL for your [Testing
505
- * Domain](https://cloudcannon.com/documentation/articles/testing-domain/) or [Custom
506
- * Domain](https://cloudcannon.com/documentation/articles/what-is-a-custom-domain/).
507
- *
508
- * This key has no default.
509
- *
510
- * https://cloudcannon.com/documentation/articles/collections-reference/#new_preview_url
511
- */
512
- new_preview_url?: string;
513
- /**
514
- * This key defines which Schemas are available to populate files in this Collection. Defining a
515
- * Schema for a collection will add it to the _+ Add_ button dropdown at the top right of the
516
- * _Collection browser_.
517
- *
518
- * The following nested keys are available for each Schema insdie schemas:
519
- *
520
- * - `path`
521
- * - `reorder_input`
522
- * - `hide_extra_inputs`
523
- * - `remove_empty_inputs`
524
- * - `remove_extra_inputs`
525
- * - `name`
526
- * - `icon`
527
- * - `preview`
528
- * - `_editables`
529
- * - `_enabled_editors`
530
- * - `_inputs`
531
- * - `_select_data`
532
- * - `_structures`
533
- * - `create`
534
- * - `new_preview_url`
535
- *
536
- * This key has no default. If undefined, clicking the _+ Add_ button to add a new file to a
537
- * Collection will clone the last file in the Collection and clear any markup content and the
538
- * values of any structured data keys.
539
- *
540
- * For more information, please read our documentation on
541
- * [Schemas](https://cloudcannon.com/documentation/articles/what-is-a-schema/).
542
- *
543
- * https://cloudcannon.com/documentation/articles/collections-reference/#schemas
544
- */
545
- schemas?: Record<string, Schema>;
546
- /**
547
- * This key defines the name for the structured data key that references the Schema a file uses.
548
- * CloudCannon automatically adds this key to the top of your file when you create it using a
549
- * Schema.
550
- *
551
- * Values which beginning with the `_` character are hidden from the Data Editor and the sidebar
552
- * of the Content and Visual Editors.
553
- *
554
- * By default, this key is `_schema`.
555
- *
556
- * https://cloudcannon.com/documentation/articles/collections-reference/#schema_key
557
- */
558
- schema_key?: string;
559
- }
560
-
561
- export interface CollectionGroup {
562
- /**
563
- * Short, descriptive label for this group of collections.
564
- */
565
- heading: string;
566
- /**
567
- * The collections shown in the sidebar for this group. Collections here are referenced by their
568
- * key within `collections_config`.
569
- */
570
- collections: string[];
571
- }
572
-
573
- export interface DataConfigEntry {
574
- /**
575
- * The path to a file or folder of files containing data.
576
- */
577
- path: string;
578
- }
579
-
580
- export interface FileConfigEntry extends Cascade {
581
- /**
582
- * The glob pattern(s) targeting a path to one or more files.
583
- */
584
- glob: string[] | string;
585
- }
586
-
587
- export interface Editor {
588
- /**
589
- * The URL used for the dashboard screenshot, and where the editor opens to when clicking the
590
- * dashboard "Edit Home" button.
591
- *
592
- * @default /
593
- */
594
- default_path: string;
595
- }
596
-
597
- export interface CommitTemplate {
598
- /**
599
- * Used to identify a commit template when multiple commit templates are available.
600
- */
601
- label?: string;
602
- /**
603
- * Set the string for the commit template. This will only be used if `template_path` is not set.
604
- */
605
- template_string?: string;
606
- /**
607
- * Sets the path for a file containing your commit template. The file path should be relative to
608
- * the root directory.
609
- */
610
- template_path?: string;
611
- /**
612
- * Define inputs used to populate data placeholders in the commit template.
613
- */
614
- _inputs?: Record<string, Input>;
615
- /**
616
- * Define additional template strings, for building nested templates.
617
- */
618
- extra_data?: Record<string, string>;
619
- /**
620
- * Sets the width of the text wrap in the editor.
621
- */
622
- wrap_width?: number;
623
- }
624
-
625
- /**
626
- * The base format for the configuration file.
627
- */
628
- export interface Configuration extends Cascade, WithPaths {
629
- /**
630
- * Controls which schema this file is validated against. Defaults to the latest schema.
631
- */
632
- version?: 'latest';
633
- /**
634
- * This key defines the base path for your source files, relative to the root folder of your
635
- * repository. Unless you use a nested folder as the source for your Site you can leave this key
636
- * empty or set it to `/`.
637
- *
638
- * By default, this key is empty.
639
- *
640
- * https://cloudcannon.com/documentation/articles/configuration-file-reference/#source
641
- */
642
- source?: string;
643
- /**
644
- * Definitions for your collections, which are the sets of content files for your site grouped by
645
- * folder. Entries are keyed by a chosen collection key, and contain configuration specific to
646
- * that collection.
647
- *
648
- * https://cloudcannon.com/documentation/articles/configuration-file-reference/#collections_config
649
- */
650
- collections_config?: Record<string, CollectionConfig>;
651
- /**
652
- * Defines which collections are shown in the site navigation and how those collections are
653
- * grouped.
654
- *
655
- * https://cloudcannon.com/documentation/articles/configuration-file-reference/#collections_groups
656
- */
657
- collection_groups?: CollectionGroup[];
658
- /**
659
- * The subpath where your output files are hosted.
660
- *
661
- * https://cloudcannon.com/documentation/articles/configuration-file-reference/#base_url
662
- */
663
- base_url?: string;
664
- /**
665
- * Controls what data sets are available to populate select and multiselect inputs.
666
- *
667
- * https://cloudcannon.com/documentation/articles/configuration-file-reference/#data_config
668
- */
669
- data_config?: Record<string, DataConfigEntry>;
670
- /**
671
- * Provides scope to configure at a file level, without adding configuration to files.
672
- *
673
- * https://cloudcannon.com/documentation/articles/configuration-file-reference/#file_config
674
- */
675
- file_config?: FileConfigEntry[];
676
- /**
677
- * Contains settings for the default editor actions on your site.
678
- *
679
- * https://cloudcannon.com/documentation/articles/configuration-file-reference/#editor.default_path
680
- */
681
- editor?: Editor;
682
- /**
683
- * This key defines the appearance and behavior of the Source Editor. The following nested keys
684
- * are available:
685
- *
686
- * - `tab_size`
687
- * - `show_gutter`
688
- * - `theme`
689
- *
690
- * This key has no default.
691
- *
692
- * For more information, please read our documentation on the [Source
693
- * Editor](https://cloudcannon.com/documentation/articles/the-source-editor/).
694
- *
695
- * https://cloudcannon.com/documentation/articles/configuration-file-reference/#source_editor
696
- */
697
- source_editor?: SourceEditor;
698
- /**
699
- * Templates for commit messages when saving changes.
700
- *
701
- * https://cloudcannon.com/documentation/articles/configuration-file-reference/#commit_templates
702
- */
703
- commit_templates?: CommitTemplate[];
704
-
705
- /**
706
- * The commit template to use when pulling changes from the upstream repository.
707
- *
708
- * https://cloudcannon.com/documentation/articles/configure-an-upstream-commit-message-template/
709
- */
710
- upstream_commit_template?: string;
711
- /**
712
- * Contains settings for various Markdown engines.
713
- *
714
- * https://cloudcannon.com/documentation/articles/configuration-file-reference/#markdown
715
- */
716
- markdown?: MarkdownSettings;
717
- /**
718
- * Specifies the time zone that dates are displayed and edited in. Also changes the suffix the
719
- * date is persisted to the file with.
720
- *
721
- * https://cloudcannon.com/documentation/articles/configuration-file-reference/#timezone
722
- *
723
- * @default Etc/UTC
724
- */
725
- timezone?: Timezone;
726
- /**
727
- * Configuration for custom snippets.
728
- *
729
- * https://cloudcannon.com/documentation/articles/configuration-file-reference/#_snippets
730
- */
731
- _snippets?: Record<string, SnippetConfig>;
732
- /**
733
- * Provides control over which snippets are available to use and/or extend within `_snippets`.
734
- *
735
- * https://cloudcannon.com/documentation/articles/configuration-file-reference/#_snippets_imports
736
- */
737
- _snippets_imports?: SnippetsImports;
738
- /**
739
- * Extended option used when creating more complex custom snippets.
740
- *
741
- * https://cloudcannon.com/documentation/articles/configuration-file-reference/#_snippets_templates
742
- */
743
- _snippets_templates?: Record<string, SnippetConfig>;
744
- /**
745
- * Extended option used when creating more complex custom snippets.
746
- *
747
- * https://cloudcannon.com/documentation/articles/configuration-file-reference/#_snippets_definitions
748
- */
749
- _snippets_definitions?: Record<string, SnippetConfig>;
750
- }