collections_config_from_glob

On this page

Description:

This key defines globs that filter which files CloudCannon should use for Collection configuration.

Values in this array are relative to the root of your repository (i.e., /, not the value of source) and must end in the file extension .cloudcannon.collections.yml.

Type:
Array<collections_config_from_glob[*]>
Items:
[*]string#

This key represents an individual glob pattern string in the collections_config_from_glob array.

The value is a string that specifies a file path pattern relative to the root of your repository. The path must end in the file extension .cloudcannon.collections.yml.

Appears in: collections_config_from_glob.

Show examplesHide examples

In this example, each Collection has its own Configuration File in the .cloudcannon/collections/ folder. The value of the collections_config_from_glob key tells CloudCannon to use all files in that folder that match the glob *.cloudcannon.collections.yml.

Copied to clipboard
collections_config_from_glob:
  - /.cloudcannon/collections/*.cloudcannon.collections.yml
{
  "collections_config_from_glob": [
    "/.cloudcannon/collections/*.cloudcannon.collections.yml"
  ]
}
Examples:

In this example, each Collection has its own Configuration File in the .cloudcannon/collections/ folder. The value of the collections_config_from_glob key tells CloudCannon to use all files in that folder that match the glob *.cloudcannon.collections.yml.

Copied to clipboard
collections_config_from_glob:
  - /.cloudcannon/collections/*.cloudcannon.collections.yml
{
  "collections_config_from_glob": [
    "/.cloudcannon/collections/*.cloudcannon.collections.yml"
  ]
}
Copied to clipboard
posts:
  path: content/posts
  icon: event
{
  "posts": {
    "path": "content/posts",
    "icon": "event"
  }
}
Open in a new tab