Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Latest
class default
import { default } from "https://deno.land/x/netlify_cms_config@v0.3.2/collections/folder.ts";

Constructors

new
default(label: string, config?: Options)

Methods

create(create?): this

Set the create option to be used to create new items in the collection

delete(del?): this

Prevents users from deleting items in a collection. Defaults to true

extension(extension: Extension): this

Set the extension to be used to parse the collection files

fields(fields: Field[]): this

Set the fields to be displayed in the collection

filter(field: string, value: string): this

Set the filter to be used to filter the collection

folder(folder: string): this

Set the folder name containing the collection files

format(format: Format): this

Set the format to be used to parse the collection files

identifierField(field: string): this

Set the field to be used as the identifier for the collection By default is "title"

mediaFolder(media_folder: string): this

Default media folder for the collection.

publicFolder(public_folder: string): this

Default public folder for the collection.

slug(slug: string): this

The slug option specifies a template for generating new filenames based on a file's creation date and title field. (This means that all collections with create: true must have a title field (a different field can be used via identifier_field). The slug template can also reference a field value by name, eg. {{title}}. If a field name conflicts with a built in template tag name - for example, if you have a field named slug, and would like to reference that field via {{slug}}, you can do so by adding the explicit fields. prefix, eg. {{fields.slug}}. Available template tags:

Any field can be referenced by wrapping the field name in double curly braces, eg. {{author}} {{slug}}: a url-safe version of the title field (or identifier field) for the file {{year}}: 4-digit year of the file creation date {{month}}: 2-digit month of the file creation date {{day}}: 2-digit day of the month of the file creation date {{hour}}: 2-digit hour of the file creation date {{minute}}: 2-digit minute of the file creation date {{second}}: 2-digit second of the file creation date

toJSON(): Record<string, unknown>

Return the collection as JSON