[changelog]
body = """
## What's Changed
{%- if version %} in {{ version | trim_start_matches(pat="v") }}{%- endif -%}
{% for commit in commits %}
{% if commit.remote.pr_title -%}
{%- set commit_message = commit.remote.pr_title -%}
{%- else -%}
{%- set commit_message = commit.message -%}
{%- endif -%}
* {{ commit_message | split(pat="\n") | first | trim }}\
{% if commit.remote.username %} by @{{ commit.remote.username }}{%- endif -%}
{% if commit.remote.pr_number %} in \
[!{{ commit.remote.pr_number }}]({{ self::project_url() }}/-/merge_requests/{{ commit.remote.pr_number }}) \
{%- endif %}
{%- endfor -%}
{%- if gitlab -%}
{% if gitlab.contributors | filter(attribute="is_first_time", value=true) | length != 0 %}
{% raw %}\n{% endraw -%}
### New Contributors
{%- endif %}\
{% for contributor in gitlab.contributors | filter(attribute="is_first_time", value=true) %}
* @{{ contributor.username }} made their first contribution
{%- if contributor.pr_number %} in \
[!{{ contributor.pr_number }}]({{ self::project_url() }}/-/merge_requests/{{ contributor.pr_number }}) \
{%- endif %}
{%- endfor -%}
{%- endif -%}
{% if version %}
{% if previous.version %}
**Full Changelog**: {{ self::project_url() }}/-/compare/{{ previous.version }}...{{ version }}
{% endif %}
{% else -%}
{% raw %}\n{% endraw %}
{% endif %}
{%- macro project_url() -%}
{%- set ci_project_url = get_env(name="CI_PROJECT_URL", default="") -%}
{%- if ci_project_url != "" -%}
{{ ci_project_url }}
{%- elif remote.gitlab.api_url and remote.gitlab.owner and remote.gitlab.repo -%}
{{ remote.gitlab.api_url | trim_end_matches(pat="/api/v4") }}/{{ remote.gitlab.owner }}/{{ remote.gitlab.repo }}
{%- elif remote.gitlab.owner and remote.gitlab.repo -%}
https://gitlab.com/{{ remote.gitlab.owner }}/{{ remote.gitlab.repo }}
{%- else -%}
{%- endif -%}
{%- endmacro -%}
"""
trim = true
footer = """
<!-- generated by git-cliff -->
"""
postprocessors = []
[git]
conventional_commits = false
filter_unconventional = true
split_commits = false
commit_preprocessors = [{ pattern = '\((\w+\s)?#([0-9]+)\)', replace = "" }]
filter_commits = false
topo_order = false
sort_commits = "newest"