document frontmatter defaults precedence
This commit is contained in:
parent
dd851943c0
commit
96a37ac1ab
|
@ -277,7 +277,7 @@ in your configuration. This way, you can for example set default layouts or defi
|
|||
defaults for your custom variables. Of course, any variable actually specified in
|
||||
the front matter overrides the defaults.
|
||||
|
||||
All defaults go under the `defaults` key, which holds a list of scope-values combinations.
|
||||
All defaults go under the `defaults` key, which holds a list of scope-values combinations ("default sets").
|
||||
The `scope` key defines for which files the defaults apply, limiting them by their `path` and
|
||||
optionally by their `type` (`page`, `post` or `draft`). The `values` key holds the actual list of defaults.
|
||||
|
||||
|
@ -301,6 +301,12 @@ defaults:
|
|||
With these defaults, all pages and posts would default to the `my-site` layout except for the posts under `about/blog`,
|
||||
who would default to the `meta-blog` layout and also have the `page.author` [liquid variable](../variables/) set to `Dr. Hyde` by default.
|
||||
|
||||
### Precedence
|
||||
You can have multiple sets of frontmatter defaults that specify defaults for the same setting. In this case, for each page or post,
|
||||
the default set with the more specific scope takes precedence. This way, you can specify defaults for a path like `/site/blog` that would
|
||||
override any defaults for `/site`. Also, if the paths are equal, a scope with a specified type is more specific. If two sets are equally
|
||||
specific, the bottom-most takes precedence.
|
||||
|
||||
## Default Configuration
|
||||
|
||||
Jekyll runs with the following configuration options by default. Unless
|
||||
|
|
Loading…
Reference in New Issue