Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs: Remove top-level file collection info (oops!) #923

Merged
merged 1 commit into from
Dec 13, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 4 additions & 29 deletions website/site/content/docs/collection-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ position: 27

All editable content types are defined in the `collections` field of your `config.yml` file, and display in the left sidebar of the Content page of the editor UI.

Collections come in two main types: `folder` and `file`.
Collections come in two main types: `folder` and `files`.


## Folder collections
Expand Down Expand Up @@ -64,36 +64,11 @@ collections:

## File collections

File collections represent a single file or grouping of files, useful for unique files with a custom set of fields.
A `files` collection contains one or more uniquely configured files. Unlike items in `folder` collections, which repeat the same configuration over all files in the folder, each item in a `files` collection has an explicitly set path, filename, and configuration. This can be useful for unique files with a custom set of fields, like a settings file or a custom landing page with a unique content structure.

### Single `file`
When configuring a `files` collection, each file in the collection is configured separately, and listed under the `files` field of the collection. Each file has its own list of `fields`, and a unique filepath specified in the `file` field (relative to the base of the repo).

Use `file` to specify a single file "collection". The value is a path to the file to be edited, relative to the base of the repository.

Example using `file`:

```yaml
- label: "Site Settings"
name: "general"
file: "site/_data/settings.json"
extension: "json"
description: "General Site Settings"
fields:
- {label: "Global title", name: "site_title", widget: "string"}
- label: "Post Settings"
name: "posts"
widget: "object"
fields:
- {label: "Number of posts on frontpage", name: front_limit, widget: number}
- {label: "Default Author", name: author, widget: string}
- {label: "Default Thumbnail", name: thumb, widget: image, class: "thumb"}
```

### Multiple `files`

You can group multiple files together under a single item in the collection list by using the `files` option. The option takes a list of single `file`-type collections.

Example using `files`:
Example:

``` yaml
- label: "Pages"
Expand Down