releaser: Improve release notes front matter
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Thu, 19 Oct 2017 10:34:03 +0000 (12:34 +0200)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Thu, 19 Oct 2017 10:34:03 +0000 (12:34 +0200)
releaser/releasenotes_writer.go

index e94ed25e1141c67d9b0acfba157d64b5b0c9da96..16df999da5cd2f924a6899c67c7dc36686a8ee74 100644 (file)
@@ -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
        }