# === 1) Tell git‑cliff where your remote lives ===
[remote.github]
owner = "sralter"
repo  = "pymaap"

# === 2) Your changelog settings ===
[changelog]
include_unreleased = true
sort_commits       = "newest"

header = """
# Changelog

All notable changes to this project will be documented in this file.
"""

body = """
{% set base_url = "https://github.com/sralter/pymaap" %}
{% for group, commits in commits | group_by(attribute="group") %}
{% if group == "feat" %}### ✨ Features
{% elif group == "fix" %}### 🩹 Fixes
{% elif group == "docs" %}### 📝 Docs
{% elif group == "style" %}### 🎨 Style
{% elif group == "refactor" %}### 🧹 Refactor
{% elif group == "perf" %}### ⚡ Performance
{% elif group == "test" %}### ✅ Tests
{% elif group == "chore" %}### 🔧 Chores
{% else %}### 📦 Other
{% endif %}

{% for commit in commits %}
- {{ commit.message | trim }} [{{ commit.id | truncate(length=7) }}]({{ base_url }}/commit/{{ commit.id }})
{% endfor %}

{% endfor %}
"""

footer = """
Generated by [git‑cliff](https://github.com/orhun/git-cliff)
"""

# === 3) Git parsing rules ===
[git]
conventional_commits   = true
filter_unconventional = true
tag_pattern           = "v[0-9]*"

# === 4) How to render Unreleased + Tags ===
[template]
unreleased = "## [Unreleased]\n"
tag        = "## Version {{ tag | split(value=\"v\") | index(value=1) }} - {{ timestamp | date(format='%Y-%m-%d') }}\n"