mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -05:00
releaser: Improve release notes front matter
This commit is contained in:
parent
3164103310
commit
c4bf03a558
1 changed files with 12 additions and 2 deletions
|
@ -281,15 +281,25 @@ func (r *ReleaseHandler) writeReleaseNotesToDocs(title, sourceFilename string) (
|
||||||
}
|
}
|
||||||
defer f.Close()
|
defer f.Close()
|
||||||
|
|
||||||
|
fmTail := ""
|
||||||
|
if strings.Count(title, ".") > 1 {
|
||||||
|
// Bug fix release
|
||||||
|
fmTail = `
|
||||||
|
images:
|
||||||
|
- images/blog/hugo-bug-poster.png
|
||||||
|
`
|
||||||
|
}
|
||||||
|
|
||||||
if _, err := f.WriteString(fmt.Sprintf(`
|
if _, err := f.WriteString(fmt.Sprintf(`
|
||||||
---
|
---
|
||||||
date: %s
|
date: %s
|
||||||
title: %q
|
title: %q
|
||||||
description: %q
|
description: %q
|
||||||
categories: ["Releases"]
|
slug: %q
|
||||||
|
categories: ["Releases"]%s
|
||||||
---
|
---
|
||||||
|
|
||||||
`, time.Now().Format("2006-01-02"), title, title)); err != nil {
|
`, time.Now().Format("2006-01-02"), title, title, title, fmTail)); err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue