Skip to content

Commit

Permalink
chore(changelog): 🧹 add CHANGELOG.md + changelog cog template
Browse files Browse the repository at this point in the history
Signed-off-by: Eric Villard <[email protected]>
  • Loading branch information
eviweb committed Apr 21, 2022
1 parent 95c63b6 commit 5fdf1ce
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changelog

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

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

- - -
48 changes: 48 additions & 0 deletions changelog.tera
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{% if version.tag and from.tag -%}
## [{{ version.tag }}]({{repository_url ~ "/compare/" ~ from.tag ~ ".." ~ version.tag}}) - {{ date | date(format="%Y-%m-%d") }}
{% elif version.tag and from.id -%}
## [{{ version.tag }}]({{repository_url ~ "/compare/" ~ from.id ~ ".." ~ version.tag}}) - {{ date | date(format="%Y-%m-%d") }}
{% else -%}
{% set from = from.id -%}
{% set to = version.id -%}

{% set from_shorthand = from.id | truncate(length=7, end="") -%}
{% set to_shorthand = version.id | truncate(length=7, end="") -%}

## Unreleased ([{{ from_shorthand ~ ".." ~ to_shorthand }}]({{repository_url ~ "/compare/" ~ from_shorthand ~ ".." ~ to_shorthand}}))
{% endif -%}

{% for type, typed_commits in commits | sort(attribute="type")| group_by(attribute="type")-%}

### {{ type | upper_first }}
{% for scope, scoped_commits in typed_commits | group_by(attribute="scope") -%}

{% for commit in scoped_commits | sort(attribute="scope") -%}
{% if commit.author and repository_url -%}
{% set author = "@" ~ commit.author -%}
{% set author_link = platform ~ "/" ~ commit.author -%}
{% set author = "[" ~ author ~ "](" ~ author_link ~ ")" -%}
{% else -%}
{% set author = commit.signature -%}
{% endif -%}
{% set commit_link = repository_url ~ "/commit/" ~ commit.id -%}
{% set shorthand = commit.id | truncate(length=7, end="") -%}
- **({{ scope }})** {{ commit.summary }} - ([{{shorthand}}]({{ commit_link }})) - {{ author }}
{% endfor -%}

{% endfor -%}

{% for commit in typed_commits | unscoped -%}
{% if commit.author and repository_url -%}
{% set author = "@" ~ commit.author -%}
{% set author_link = platform ~ "/" ~ commit.author -%}
{% set author = "[" ~ author ~ "](" ~ author_link ~ ")" -%}
{% else -%}
{% set author = commit.signature -%}
{% endif -%}
{% set commit_link = repository_url ~ "/commit/" ~ commit.id -%}
{% set shorthand = commit.id | truncate(length=7, end="") -%}
- {{ commit.summary }} - ([{{shorthand}}]({{ commit_link }})) - {{ author }}
{% endfor -%}

{% endfor -%}

0 comments on commit 5fdf1ce

Please sign in to comment.