Metadata lets you add bits of information to documents and control their behavior.

There are several ways to add metadata to both content and data files and metadata is merged together from multiple sources to determine the complete set of metadata for a given document. This data cascade (credit to 11ty for the excellent term) applies metadata from the lowest priority source to the highest. A document will contain metadata from all the sources, but if a higher priority metadata source contains the same key as a lower priority one, the value from the higher priority source will take precedence.

Note that global settings cascade to documents. This can be helpful because it means you can define metadata that's intended for use by documents as a global setting and it will cascade to every document as a default value.

Here are the default metadata sources from lowest priority to highest. Think of metadata being applied (or cascaded) from the top of this list to the bottom, with duplicate keys overwriting existing values along the way.

Child Pages

Directory Metadata

Directory metadata allows you to specify metadata that applies to all files in a given directory (and optionally all subdirectories).

Sidecar Files

Sidecar files let you define metadata in a separate file.

Front Matter

Front matter is a common concept in static generators that lets you define metadata for a file in a file header.