# git-cliff configuration for generating CHANGELOG.md with GitHub usernames and contributors
# see: https://git-cliff.org/docs/integration/github
[remote.github]
owner = "StudentWeis"
repo = "mdref"
[changelog]
header = """
# Changelog
All notable changes to this project will be documented in this file.
"""
# Per-release body template: include GitHub usernames and new contributors
body = """
{% if version -%}
## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }}
{% else -%}
## [Unreleased]
{% endif -%}
{% for group, commits in commits | group_by(attribute="group") %}
### {{ group | upper_first }}
{%- for commit in commits %}
- {{ commit.message | split(pat="\n") | first | upper_first | trim }}{% if commit.remote.username %} by @{{ commit.remote.username }}{% elif commit.github.username %} by @{{ commit.github.username }}{% elif commit.author.name %} by @{{ commit.author.name }}{% endif %}{% if commit.remote.pr_number %} in [#{{ commit.remote.pr_number }}](https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }}/pull/{{ commit.remote.pr_number }}){% elif commit.github.pr_number %} in [#{{ commit.github.pr_number }}](https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }}/pull/{{ commit.github.pr_number }}){% endif %}
{%- endfor %}
{% endfor %}
{%- if github.contributors | filter(attribute="is_first_time", value=true) | length != 0 %}
### New Contributors
{% for contributor in github.contributors | filter(attribute="is_first_time", value=true) %}
- @{{ contributor.username }} made their first contribution{% if contributor.pr_number %} in [#{{ contributor.pr_number }}](https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }}/pull/{{ contributor.pr_number }}){% endif %}
{% endfor %}
{%- endif %}
"""
footer = """
<!-- generated by git-cliff -->
"""
# Tidy whitespace
trim = true
[git]
# Use conventional commits when available, fall back otherwise
conventional_commits = true
filter_unconventional = false
# Keep newest commits first
sort_commits = "newest"
# Optional: small commit preprocessors
commit_preprocessors = [
{ pattern = '\\((\\w+\\s)?#([0-9]+)\\)', replace = "" }
]