diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2017-10-19 12:34:03 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2017-10-19 12:34:03 +0200 |
commit | c4bf03a55804eb9d80b0df5774bc6d52e1035d69 (patch) | |
tree | 5da0684c9fa259b44f7e29529cca133931b5ac3c /releaser/releasenotes_writer.go | |
parent | 3164103310fbca1211cfa9ce4a5eb7437854b6ad (diff) |
releaser: Improve release notes front matter
Diffstat (limited to 'releaser/releasenotes_writer.go')
-rw-r--r-- | releaser/releasenotes_writer.go | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/releaser/releasenotes_writer.go b/releaser/releasenotes_writer.go index e94ed25e1..16df999da 100644 --- a/releaser/releasenotes_writer.go +++ b/releaser/releasenotes_writer.go @@ -281,15 +281,25 @@ func (r *ReleaseHandler) writeReleaseNotesToDocs(title, sourceFilename string) ( } 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(` --- date: %s title: %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 } |