# `changelog`

This section contains the configuration options for changelog generation.

### Example

<!-- {% raw %} -->

```toml
[changelog]
header = "Changelog"
body = """
{% for group, commits in commits | group_by(attribute="group") %}
    ### {{ group | upper_first }}
    {% for commit in commits %}
        - {{ commit.message | upper_first }}
    {% endfor %}
{% endfor %}
"""
trim = true
footer = "<!-- generated by git-cliff -->"
postprocessors = [{ pattern = "foo", replace = "bar"}]
```

<!-- {% endraw %} -->

See [templating](/docs/category/templating) for more detail.

### header

Header template that will be rendered and added to the beginning of the changelog.

The template context contains the full list of releases in the variable `releases`. See [templating](/docs/category/templating) for more details.

### body

Body template that will be rendered for each release in the changelog. For example, if the changelog contains 3 releases, it will be rendered 3 times, once for each release.

The template context contains one release in the variable `release`. See [templating](/docs/category/templating) for more detail.

### footer

Footer template that will be rendered and added to the end of the changelog.

The template context contains the full list of releases in the variable `releases`. See [templating](/docs/category/templating) for more details.

See [Keep a Changelog configuration](/docs/templating/examples#keep-a-changelog) for seeing the example of adding links to the end of the changelog.

### trim

If set to `true`, leading and trailing whitespace are removed from the [`body`](#body).

It is useful for adding indentation to the template for readability, as shown [in the example](#example).

### render_always

If set to `true`, the changelog [body](#body) will be rendered even if there are no releases to process.

### postprocessors

An array of commit postprocessors for manipulating the changelog before outputting.
Can e.g. be used for replacing commit author with GitHub usernames.
Internally postprocessors and preprocessors are the same. See [commit_preprocessors](/docs/configuration/git#commit_preprocessors) for more detail and examples, it uses the same syntax.

### output

Output file path for the changelog. You can also use the `--output` argument to override this value.
