From c485c3ee85ab790fd097af58da2bc73531ab651a Mon Sep 17 00:00:00 2001 From: maulik13 Date: Fri, 12 Feb 2021 13:55:08 +0100 Subject: [PATCH] docs(changelog): update changelog template example --- examples/changelog.tmpl | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/examples/changelog.tmpl b/examples/changelog.tmpl index f8f4486..4f4216d 100644 --- a/examples/changelog.tmpl +++ b/examples/changelog.tmpl @@ -1,5 +1,26 @@ +{{ define "commitList" }} +{{ range $index,$commit := .BreakingChanges -}} +{{ if eq $index 0 -}} +## BREAKING CHANGES +{{ end -}} +* {{ if $commit.Scope }}**{{$.Backtick}}{{$commit.Scope}}{{$.Backtick}}**{{ end }} {{$commit.ParsedBreakingChangeMessage}} +introduced by commit: +{{$commit.ParsedMessage}} {{if $.HasURL}} ([{{ printf "%.7s" $commit.Commit.Hash}}]({{ replace $.URL "{{hash}}" $commit.Commit.Hash}})){{end}} +{{ end -}} +{{ range $key := .Order -}} +{{ $commits := index $.Commits $key -}} +{{ if $commits -}} +### {{ $key }} +{{ range $index,$commit := $commits -}} +* {{ if $commit.Scope }}**{{$.Backtick}}{{$commit.Scope}}{{$.Backtick}}** {{end}}{{$commit.ParsedMessage}}{{if $.HasURL}} ([{{ printf "%.7s" $commit.Commit.Hash}}]({{ replace $.URL "{{hash}}" $commit.Commit.Hash}})){{end}} +{{ end -}} +{{ end -}} +{{ end -}} +{{ end -}} + # My custom release template v{{$.Version}} ({{.Now.Format "2006-01-02"}}) -{{ .Commits -}} +{{ template "commitList" .CommitsContent -}} + {{ if .HasDocker}} ## Docker image