☁️ Loving our new documentation website? Provide feedback in the CloudCannon Community! ✨

schemas_from_glob

Table of contents

Description:

This key defines globs that filter which files CloudCannon should use for Schema 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.schemas.yml.

You can use this key anywhere you would use the schemas key.

This key has no default.

Appears in:
└── collections_config
    └── *
        └── schemas_from_glob
Type:
Array<schemas_from_glob[*]>
Items:
[*]string#

This key represents an individual glob pattern string in the collections_config.*.schemas_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.schemas.yml.

Show examplesHide examples

In this example, we have several Schema Configuration Files in the .cloudcannon/schemas/ folder. The value of the schemas_from_glob key tells CloudCannon to use all files in that folder that match the glob *.cloudcannon.schemas.yml except for pages.cloudcannon.schemas.yml due to the negative glob.

Copied to clipboard
posts:
  path: content/posts
  icon: event
  schemas_from_glob:
    - /.cloudcannon/schemas/*.cloudcannon.schemas.yml
    - '!/.cloudcannon/schemas/pages.cloudcannon.schemas.yml'
{
  "posts": {
    "path": "content/posts",
    "icon": "event",
    "schemas_from_glob": [
      "/.cloudcannon/schemas/*.cloudcannon.schemas.yml",
      "!/.cloudcannon/schemas/pages.cloudcannon.schemas.yml"
    ]
  }
}
Examples:

In this example, we have several Schemas Configuration Files in the .cloudcannon/schemas/ folder. The value of the schemas_from_glob key tells CloudCannon to use all files in that folder that match the glob *.cloudcannon.schemas.yml except for pages.cloudcannon.schemas.yml due to the negative glob.

Copied to clipboard
posts:
  path: content/posts
  icon: event
  schemas_from_glob:
    - /.cloudcannon/schemas/*.cloudcannon.schemas.yml
    - '!/.cloudcannon/schemas/pages.cloudcannon.schemas.yml'
{
  "posts": {
    "path": "content/posts",
    "icon": "event",
    "schemas_from_glob": [
      "/.cloudcannon/schemas/*.cloudcannon.schemas.yml",
      "!/.cloudcannon/schemas/pages.cloudcannon.schemas.yml"
    ]
  }
}
Open in a new tab