From 9dd68467af31440377a11dfa75465021ebc5c715 Mon Sep 17 00:00:00 2001 From: Jimmy Briggs Date: Mon, 11 Mar 2024 20:57:20 -0400 Subject: [PATCH] Update cliff.template.toml --- workflow-templates/cliff.template.toml | 36 ++++++++++++++++++++------ 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/workflow-templates/cliff.template.toml b/workflow-templates/cliff.template.toml index 74a5e34..bdef9f4 100644 --- a/workflow-templates/cliff.template.toml +++ b/workflow-templates/cliff.template.toml @@ -16,26 +16,45 @@ header = """ # body - see https://tera.netlify.app/docs/#introduction body = """ {% if version %}\ - ## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }} + ## [{{ version | trim_start_matches(pat="v") }}]\ + {% if previous %}\ + {% if previous.version %}\ + (REPOSITORY_URL/compare/{{ previous.version }}...{{ version }})\ + {% else %}\ + (REPOSITORY_URL/tree/{{ version }})\ + {% endif %}\ + {% endif %}\ + - ({{ 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 %} - - {% if commit.breaking %}[**breaking**] {% endif %}{{ commit.message | upper_first }}\ - {% endfor %} + ## {{ group | upper_first }} + {% for commit in commits %} + - {% if commit.scope %}\ + **{{commit.scope}}:** \ + {% endif %}\ + {% if '```' in commit.message %}\ + {{ commit.message | upper_first }}\n\ + ([{{ commit.id | truncate(length=7, end="") }}](REPOSITORY_URL/commit/{{ commit.id }})) - ({{ commit.author.name }})\ + {% else %}\ + {{ commit.message | upper_first }} ([{{ commit.id | truncate(length=7, end="") }}](REPOSITORY_URL/commit/{{ commit.id }})) - ({{ commit.author.name }})\ + {% endif %}\ + {% if commit.breaking %}\ + {% for breakingChange in commit.footers %}\ + \n{% raw %} {% endraw %}- **{{ breakingChange.token }}{{ breakingChange.separator }}** {{ breakingChange.value }}\ + {% endfor %}\ + {% endif %}\ + {% endfor %} {% endfor %}\n """ -# footer footer = """ *** *Changelog generated by [git-cliff](https://github.com/orhun/git-cliff).* *** """ -# commits [git] conventional_commits = true filter_unconventional = true @@ -50,7 +69,8 @@ split_commits = false protect_breaking_commits = true # limit_commits = 42 commit_preprocessors = [ - { pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](https://github.com/orhun/git-cliff/issues/${2}))" }, + { pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](REPOSITORY_URL/issues/${2}))"}, + { pattern = "Merge pull request #([0-9]+) from [^ ]+", replace = "PR [#${1}](REPOSITORY_URL/pull/${1}):"}, ] commit_parsers = [ { message = "^feat", group = "Features" },