New Configuration Options
File Matching
When specifying defaults it is possible to use match
instead of (or in addition to) scope
to perform a file glob match, for example:
defaults:
- values:
layout: default
- match: '*.css'
values:
layout: none
permalink: /:path/:basename-:digest:output_ext
- match: '{blog,_posts,_drafts}/'
values:
title: 'My Awesome Blog'
Here we make files use default
as layout but for CSS files we set no layout and include a digest in their permalink, and for files under blog/
, _posts/
, and _drafts/
we set a default title.
If the file match pattern ends with /
then it implies all files below that directory (this is an extension to the normal file pattern syntax).
The value of the match
setting can be either an array or string.
Default values are applied from first to last with no other ranking being done.
source_dir
It is possible to set source_dir
which only affects content files, so for example with this config:
source_dir: _content
collections_dir: _collections
The project structure would be as follows:
.
├── _config.yml
├── _content
│ └── index.md
├── _collections
│ └── _posts
│ └── 2018-09-13-hello-world.md
└── _site
├── index.html
└── 2018
└── 09
└── 13
└── hello-world.html