diff --git a/content/docs/reference/collections.mdx b/content/docs/reference/collections.mdx index f5d2ec3e8..af437992a 100644 --- a/content/docs/reference/collections.mdx +++ b/content/docs/reference/collections.mdx @@ -1,8 +1,7 @@ --- id: collections - title: Collections -last_edited: '2023-03-01T15:51:56.737Z' +last_edited: '2024-10-29T07:27:46.292Z' next: content/docs/reference/fields.mdx previous: content/docs/reference/schema.mdx --- @@ -16,8 +15,8 @@ Collections represent a type of content (EX, blog post, page, author, etc). We r | [`name`](#name) | The name of the collection | | [`path`](#path) | The path (relative to where the CLI is running) to a folder where the content is stored. | | [`format`](#format) | The extension of all the documents in this collection (Default is "md"). Must be one of `"md"`, `"markdown"`, `"mdx"`,`"json"`, `"toml"`, or `"yaml"`. | -| [`match.include`](#match.include) | A [glob pattern]() (without the file extension) that will be used to match a subset of the files in the `path` folder. | -| [`match.exclude`](#match.exclude) | A [glob pattern]() (without the file extension) that will be used to exclude a subset of the files in the `path` folder. | +| [`match.include`](#match.include) | A [glob pattern](https://en.wikipedia.org/wiki/Glob_\(programming\)) (without the file extension) that will be used to match a subset of the files in the `path` folder. | +| [`match.exclude`](#match.exclude) | A [glob pattern](https://en.wikipedia.org/wiki/Glob_\(programming\)) (without the file extension) that will be used to exclude a subset of the files in the `path` folder. | | `label` | A human friendly label that will be displayed to the user | | `fields` | An array of [fields](/docs/reference/fields/) | | `templates` | An array of [templates](/docs/reference/templates/) | @@ -25,12 +24,14 @@ Collections represent a type of content (EX, blog post, page, author, etc). We r | `frontmatterFormat` | The format used to parse the frontmatter. This can be `"yaml"` ,`"toml"`, or `"json"`. It defaults to `"yaml"` | | `frontmatterDelimiters` | The Delimiters used for the frontmatter for a document. This is what Has type `string \| [string, string]` . The default is `---`. Read more about delimiters [here](https://github.com/jonschlinkert/gray-matter#optionsdelimiters) | | `ui.filename` | See [Filename customization](/docs/extending-tina/filename-customization/) | -| `ui.beforeSubmit` | This function is called before the form is submitted. If values are returned from this function they will be the values used to submit the form. (_optional_) | -| `ui.global` | A boolean that if true will make this collection Global. (_optional_) | -| `ui.router` | A function that takes in a document and returns the route for it. If nothing is returned the basic editor will be used. Read more about visual editing [here](/docs/contextual-editing/router/#the-router-property)(_optional_) | -| `ui.allowedActions.create` | If this is false, the create button will not appear in the collection list page. See [example](#example-with-allowed-actions). (_optional_) | -| `ui.allowedActions.delete` | If this is false, the create delete button will not appear in the collection list page. See [example](#example-with-allowed-actions). (_optional_) | -| `ui.allowedActions.createNestedFolder` | If this is false, the create folder button will not appear in the collection list page. See [example](#example-with-allowed-actions). (_optional_) | +| `ui.beforeSubmit` | This function is called before the form is submitted. If values are returned from this function they will be the values used to submit the form. (*optional*) | +| `ui.global` | A boolean that if true will make this collection Global. (*optional*) | +| `ui.router` | A function that takes in a document and returns the route for it. If nothing is returned the basic editor will be used. Read more about visual editing [here](/docs/contextual-editing/router/#the-router-property)(*optional*) | +| `ui.allowedActions.create` | If this is false, the create button will not appear in the collection list page. See [example](#example-with-allowed-actions). (*optional*) | +| `ui.allowedActions.delete` | If this is false, the create delete button will not appear in the collection list page. See [example](#example-with-allowed-actions). (*optional*) | +| `ui.allowedActions.createNestedFolder` | If this is false, the create folder button will not appear in the collection list page. See [example](#example-with-allowed-actions). (*optional*) | +| `ui.filename.description` | A short description for the filename field that will be displayed to the user (*optional*, can include html formatting e.g. style attributes) | +| `ui.filename.showFirst` | A boolean that if true will render the filename field at the top of the form (*optional*, default `false`) | > Note: Must provide only one of `fields` or `templates` but never both @@ -78,7 +79,7 @@ export const defineConfig({ ## match.include -A [glob pattern]() that will be used to match a subset of the files in the `path` directory. +A [glob pattern](https://en.wikipedia.org/wiki/Glob_\(programming\)) that will be used to match a subset of the files in the `path` directory. The provided pattern does not have to include the file extension. The extension will be added automatically based on the [`format`](#format) of the collection. The final pattern that is used will be determined by `match`, `format` and `path`. @@ -101,11 +102,11 @@ The final pattern used would be ### Basic Syntax -- `?` matches a single character -- `*` matches any number of any characters (except `/`) -- `[abc]` matches any one character in the given set -- `[a-z]` matches a range. -- `{foo,bar}` matches any whole word in the given set +* `?` matches a single character +* `*` matches any number of any characters (except `/`) +* `[abc]` matches any one character in the given set +* `[a-z]` matches a range. +* `{foo,bar}` matches any whole word in the given set ### Some common glob patterns