Skip to content

Commit 3286c50

Browse files
add other links to release notes page
1 parent 450e447 commit 3286c50

File tree

2 files changed

+44
-2
lines changed

2 files changed

+44
-2
lines changed

internal/assets/markdown-index-template.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
## {{.Version}} [{{.Repo}}-release-notes-{{.Version}}]
2-
{{ if or .Feature .Enhancement .Security .BugFix }}
3-
{{ if or .Feature .Enhancement }}
2+
{{ if or .KnownIssue .BreakingChange .Deprecation }}
3+
{{ other_links }}{{- end }}
4+
{{ if or .Feature .Enhancement .Security .BugFix }}{{ if or .Feature .Enhancement }}
45
### Features and enhancements [{{.Repo}}-{{.Version}}-features-enhancements]
56
{{ if .Feature }}{{ range $k, $v := .Feature }}{{ range $item := $v }}
67
* {{ $item.Summary | beautify }} {{ linkPRSource $item.Component $item.LinkedPR }} {{ linkIssueSource $item.Component $item.LinkedIssue }}{{ if $item.Description }}

internal/changelog/renderer.go

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,47 @@ func (r Renderer) Render() error {
128128
re := regexp.MustCompile(`\n|\r|^`)
129129
return re.ReplaceAllString(s, "\n ")
130130
},
131+
"other_links": func() string {
132+
var links []string
133+
if len(td.KnownIssue) > 0 {
134+
links = append(
135+
links,
136+
fmt.Sprintf(
137+
"[Known issues](/release-notes/known-issues.md#%s-%s-known-issues)",
138+
r.repo,
139+
r.changelog.Version,
140+
),
141+
)
142+
}
143+
if len(td.BreakingChange) > 0 {
144+
links = append(
145+
links,
146+
fmt.Sprintf(
147+
"[Breaking changes](/release-notes/breaking-changes.md#%s-%s-breaking-changes)",
148+
r.repo,
149+
r.changelog.Version,
150+
),
151+
)
152+
}
153+
if len(td.Deprecation) > 0 {
154+
links = append(
155+
links,
156+
fmt.Sprintf(
157+
"[Deprecations](/release-notes/deprecations.md#%s-%s-deprecations)",
158+
r.repo,
159+
r.changelog.Version,
160+
),
161+
)
162+
}
163+
if len(links) > 0 {
164+
return fmt.Sprintf(
165+
"_This release also includes: %s._",
166+
strings.Join(links, " and"),
167+
)
168+
} else {
169+
return ""
170+
}
171+
},
131172
// Ensure components have section styling
132173
"header2": func(s1 string) string {
133174
return fmt.Sprintf("**%s**", s1)

0 commit comments

Comments
 (0)