-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathchangelog-markdown.tmpl
34 lines (32 loc) · 1.25 KB
/
changelog-markdown.tmpl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
{{- /* ===== entry template ==== */ -}}
{{ define "entry" }}
- {{ trim $.Message }}
{{ range $i, $github := $.ParsedGithubs }} [{{ $github.Name }}]({{ $github.Link }}) {{- end }}
{{ range $i, $jira := $.ParsedJiras }} [{{ $jira.ID }}]({{ $jira.Link }}) {{- end }}
{{- end }}
{{- /* ===== entry template ==== */ -}}
{{- /* ==== section template ==== */ -}}
{{- define "section" }}
{{- if .scopes }}
{{- $length := len .scopes }}
{{- if gt $length 0 }}
### {{ .sectionName }}
{{- range $i, $scope := .scopes }}
{{- if gt $length 0 }}
#### {{ $scope.ScopeName }}
{{- end }}
{{- range $j, $entry := $scope.Entries }}
{{ template "entry" $entry }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- /* ==== section template ==== */ -}}
## {{ .Title }}
{{ template "section" (dict "sectionName" "Performance" "scopes" .Type.performance) }}
{{ template "section" (dict "sectionName" "Breaking Changes" "scopes" .Type.breaking_change ) }}
{{ template "section" (dict "sectionName" "Deprecations" "scopes" .Type.deprecation ) }}
{{ template "section" (dict "sectionName" "Dependencies" "scopes" .Type.dependency ) }}
{{ template "section" (dict "sectionName" "Features" "scopes" .Type.feature ) }}
{{ template "section" (dict "sectionName" "Fixes" "scopes" .Type.bugfix ) }}