What's on this page
Cecil 9.18.0: a smarter configuration merge
Cecil 9.18.0 reworks how your configuration is merged with the defaults and with the themes configuration. The goal: define only what you want to change, and get a predictable result.
Layered configuration
The effective configuration is now built from layers, each one overriding the previous ones:
- Cecil default configuration
- themes configuration
- site configuration (
cecil.yml) - environment variables (
CECIL_*) and command line options
Maps are merged key by key with the default ones: for example, adding a format to layouts.translations.formats no longer drops the built-in loaders. Themes can also override built-in defaults, such as default pages, generators and output formats.
A map can be enabled or disabled with a simple boolean, without losing its options:
cache: false # same as `cache: {enabled: false}`
Lists of values
When you define a list of values (e.g. pages.ext, output.pagetypeformats or assets.images.responsive.widths), it now replaces the default list. If a theme defines the same list, your values are added to the theme ones, as they can be required by the theme.
To adjust a default (or theme) list instead, use a map: true adds a value, false removes it.
output:
pagetypeformats:
homepage:
rss: true # adds RSS
atom: false # removes Atom
Output formats are merged by name, so - {name: rss, filename: feed} overrides only the filename of the RSS format.
Deprecated options
Deprecated options are now checked before the configuration validation, and all of them are reported at once, with their source and the snippet to use instead:
Deprecated configuration option(s) in "cecil.yml":
- Option `frontmatter` must be moved to:
```
pages:
frontmatter: yaml
```
- Option `pages.body.format` is deprecated and must be removed.
New enabled test in templates
Since a disabled map is still a map, use the new enabled test to check an option in templates:
{% if config.cache is enabled %}
Breaking changes
Please check your configuration before upgrading:
- A list of values defined in several
--configfiles is now replaced by the last one, instead of being concatenated. - A site can no longer clear a theme list by redefining it (
homepage: []): remove each value withfalse. - A theme configuration now overrides the built-in default pages, generators and output formats.
{% if config.cache %}is true even when the cache is disabled withcache: false: use{% if config.cache is enabled %}instead.
Run cecil show:config to display the full effective configuration, defaults included.
See the configuration documentation for more details, and update Cecil to get this release.
Release notes on GitHub