refactor(changelog): split get version header
parent
e643400357
commit
694261892c
|
@ -45,9 +45,7 @@ func (g *MarkdownGenerator) Generate(commits []convention.Commit) string {
|
||||||
nodes = append(nodes, markdown.NewHeader(firstLevel, title))
|
nodes = append(nodes, markdown.NewHeader(firstLevel, title))
|
||||||
|
|
||||||
// version
|
// version
|
||||||
year, month, day := g.t.Date()
|
nodes = append(nodes, markdown.NewHeader(secondLevel, g.getVersionHeader()))
|
||||||
versionHeader := fmt.Sprintf("%s (%d-%d-%d)", g.version, year, month, day)
|
|
||||||
nodes = append(nodes, markdown.NewHeader(secondLevel, versionHeader))
|
|
||||||
|
|
||||||
// new
|
// new
|
||||||
nodes = append(nodes, newBases...)
|
nodes = append(nodes, newBases...)
|
||||||
|
@ -121,3 +119,8 @@ func (g *MarkdownGenerator) getOldNodes() []markdown.Node {
|
||||||
|
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (g *MarkdownGenerator) getVersionHeader() string {
|
||||||
|
year, month, day := g.t.Date()
|
||||||
|
return fmt.Sprintf("%s (%d-%d-%d)", g.version, year, month, day)
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue