diff --git a/src/templates/Base.js b/src/templates/Base.js index ed1c2f77..a7f4df38 100644 --- a/src/templates/Base.js +++ b/src/templates/Base.js @@ -62,7 +62,8 @@ export default class Base { } renderMerge = ({ pr, message }) => { - return `* ${pr}: ${message}` + const href = pr.replace('#', this.origin + '/pull/') + return `* [${pr}](${href}): ${message}` } renderFixes = (fixes) => { @@ -77,7 +78,9 @@ export default class Base { } renderFixNumber = (string) => { - return string.replace(this.origin + '/issues/', '#') + const href = string.replace('#', this.origin + '/issues/') + const number = string.replace(this.origin + '/issues/', '#') + return `[${number}](${href})` } renderCommits = (commits) => { @@ -91,7 +94,9 @@ export default class Base { } renderCommit = ({ hash, subject }) => { - return `* ${hash.slice(0, this.commitHashLength)}: ${subject}` + const href = `${this.origin}/commit/${hash}` + const shortHash = hash.slice(0, this.commitHashLength) + return `* [\`${shortHash}\`](${href}): ${subject}` } sortCommits = (a, b) => { diff --git a/test/data/changelog.js b/test/data/changelog.js index ac920604..da34d829 100644 --- a/test/data/changelog.js +++ b/test/data/changelog.js @@ -7,23 +7,23 @@ Generated by [auto-changelog](https://github.com/CookPete/auto-changelog) ## [Unreleased](https://github.com/user/repo/compare/v0.0.2...HEAD) ### Fixed -* #6: Unreleased commit +* [#6](https://github.com/user/repo/issues/6): Unreleased commit ## [v0.0.2](https://github.com/user/repo/compare/v0.0.1...v0.0.2) - 2015-12-28 ### Merged -* #5: Should not parse #4 in PR title +* [#5](https://github.com/user/repo/pull/5): Should not parse #4 in PR title ### Fixed -* #4: Commit 4 fixes #4 in the subject +* [#4](https://github.com/user/repo/issues/4): Commit 4 fixes #4 in the subject ## v0.0.1 - 2015-12-15 ### Merged -* #3: Pull request title +* [#3](https://github.com/user/repo/pull/3): Pull request title ### Fixed -* #1, #2: Second commit +* [#1](https://github.com/user/repo/issues/1), [#2](https://github.com/user/repo/issues/2): Second commit `