Defining the default contents of new files

Provide default front matter and/or content for new collection items.

To define defaults, create a file called in the root of the collection folder. When creating a new item in that collection, front matter and content will be copied from

Default files are hidden in the collection view to prevent an editor accidentally changing them.


Set the default extension for new files to .html by using _defaults.html instead.

Defaults are scoped to their collection. For example:

  • /_staff/ contains defaults for new staff members
  • /_posts/ contains defaults for new posts

Creating a new item in these collections will copy the information from the relevant file. If the title and name attributes are present, they are set to the name of the new item.


Looking to set the default values for new array items? Use Array Structures instead.

Was this article helpful? or Suggest an improvement >

Related articles