API

Defaults

Overview

Defaults are a great way to add common values across a range of content. If you find yourself repeating metadata fields across pages, or using a certain layout for all your posts, defaults can help you out.

Check out the Jekyll documentation for more examples.

Default

A default is a hash of scoped values that apply to particular content.

Input

Name Type Desc
path String File path to scope values to, otherwise applies to everything
type String Type of file to apply to: pages, posts, drafts or a collection
values Hash<String, *> Arbitrary key/value pairs

Example

Defaults are added via the Sites endpoint within the defaults array.

{
  "defaults": [
    {
      "type": "posts",
      "values": {
        "layout": "post",
        "author": "Jill Smith"
      }
    },
    {
      "path": "projects",
      "values": {
        "layout": "project",
        "images": []
      }
    }
  ]
}

Help improve this page