aboutsummaryrefslogtreecommitdiffhomepage
path: root/releaser
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <[email protected]>2019-07-30 09:02:03 +0200
committerBjørn Erik Pedersen <[email protected]>2019-07-30 09:02:03 +0200
commit2c7c361091618868581c4a02352e7c37ccc12753 (patch)
tree380b95c3f8c060669c32fa14737ddd71acc16ae3 /releaser
parentc62bbf7b11d68d52ef11a4c6c70660914c473d08 (diff)
downloadhugo-2c7c361091618868581c4a02352e7c37ccc12753.tar.gz
hugo-2c7c361091618868581c4a02352e7c37ccc12753.zip
releaser: Create a proper automated title for patch releases
Fixes #6126
Diffstat (limited to 'releaser')
-rw-r--r--releaser/releasenotes_writer.go4
-rw-r--r--releaser/releaser.go10
2 files changed, 11 insertions, 3 deletions
diff --git a/releaser/releasenotes_writer.go b/releaser/releasenotes_writer.go
index 146cee198..82bcc629b 100644
--- a/releaser/releasenotes_writer.go
+++ b/releaser/releasenotes_writer.go
@@ -272,7 +272,7 @@ func (r *ReleaseHandler) writeReleaseNotesToTemp(version string, isPatch bool, i
}
-func (r *ReleaseHandler) writeReleaseNotesToDocs(title, sourceFilename string) (string, error) {
+func (r *ReleaseHandler) writeReleaseNotesToDocs(title, description, sourceFilename string) (string, error) {
targetFilename := "index.md"
bundleDir := strings.TrimSuffix(filepath.Base(sourceFilename), "-ready.md")
contentDir := hugoFilepath("docs/content/en/news/" + bundleDir)
@@ -315,7 +315,7 @@ description: %q
categories: ["Releases"]%s
---
- `, time.Now().Format("2006-01-02"), title, title, fmTail)); err != nil {
+ `, time.Now().Format("2006-01-02"), title, description, fmTail)); err != nil {
return "", err
}
diff --git a/releaser/releaser.go b/releaser/releaser.go
index 178ad02a6..61b9d211f 100644
--- a/releaser/releaser.go
+++ b/releaser/releaser.go
@@ -95,6 +95,8 @@ func (r *ReleaseHandler) Run() error {
version := newVersion.String()
tag := "v" + version
isPatch := newVersion.PatchLevel > 0
+ mainVersion := newVersion
+ mainVersion.PatchLevel = 0
// Exit early if tag already exists
exists, err := tagExists(tag)
@@ -193,8 +195,14 @@ func (r *ReleaseHandler) Run() error {
releaseNotesFile := getReleaseNotesDocsTempFilename(version, true)
+ title, description := version, version
+ if isPatch {
+ title = "Hugo " + version + ": A couple of Bug Fixes"
+ description = "This version fixes a couple of bugs introduced in " + mainVersion.String() + "."
+ }
+
// Write the release notes to the docs site as well.
- docFile, err := r.writeReleaseNotesToDocs(version, releaseNotesFile)
+ docFile, err := r.writeReleaseNotesToDocs(title, description, releaseNotesFile)
if err != nil {
return err
}