-
-
Notifications
You must be signed in to change notification settings - Fork 158
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(website): split the configuration section
- Loading branch information
Showing
3 changed files
with
94 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# `changelog` | ||
|
||
This section contains the configuration options for changelog generation. | ||
|
||
<!-- {% 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 %} --> | ||
|
||
### header | ||
|
||
Header text that will be added to the beginning of the changelog. | ||
|
||
### body | ||
|
||
Body template that represents a single release in the changelog. | ||
|
||
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 is the same as [`body`](#body) and contains all the releases instead of a single release. | ||
|
||
For example, to get the list of releases, use the `{{ releases }}` variable in the template. To get information about a single release, iterate over this array and access the fields similar to [`body`](#body). | ||
|
||
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](#changelog). | ||
|
||
### 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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
--- | ||
sidebar_position: 4 | ||
--- | ||
# Configuration | ||
|
||
**git-cliff** configuration file supports [TOML](https://github.com/toml-lang/toml) (preferred) and [YAML](https://yaml.org) formats. | ||
|
||
The configuration file is read from `$HOME/git-cliff/cliff.toml` if the file exists. This location depends on the platform, for example: | ||
|
||
- on Linux: `/home/<user>/.config/git-cliff/cliff.toml` | ||
- on Windows: `C:\Users\<user>\AppData\Roaming\git-cliff\cliff.toml` | ||
- on macOS: `/Users/<user>/Library/Application Support/git-cliff/cliff.toml` | ||
|
||
See [cliff.toml](https://github.com/orhun/git-cliff/blob/main/config/cliff.toml) for the default configuration values. | ||
|
||
## Environment Configuration Overrides | ||
|
||
It's possible to use environment variables to override configuration elements. If an environment variable matches a configuration element, the variable's value will be used instead of the element's. | ||
|
||
Format: | ||
|
||
``` | ||
[PREFIX]__[CONFIG SECTION]__[FIELD NAME] | ||
``` | ||
|
||
#### Examples | ||
|
||
To override the `footer` element: | ||
|
||
```bash | ||
export GIT_CLIFF__CHANGELOG__FOOTER="<!-- footer from env -->" | ||
``` | ||
|
||
To override the `ignore_tags` element: | ||
|
||
```bash | ||
export GIT_CLIFF__GIT__IGNORE_TAGS="v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+" | ||
``` |