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))
|
||||
|
||||
// version
|
||||
year, month, day := g.t.Date()
|
||||
versionHeader := fmt.Sprintf("%s (%d-%d-%d)", g.version, year, month, day)
|
||||
nodes = append(nodes, markdown.NewHeader(secondLevel, versionHeader))
|
||||
nodes = append(nodes, markdown.NewHeader(secondLevel, g.getVersionHeader()))
|
||||
|
||||
// new
|
||||
nodes = append(nodes, newBases...)
|
||||
|
@ -121,3 +119,8 @@ func (g *MarkdownGenerator) getOldNodes() []markdown.Node {
|
|||
|
||||
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