diff --git a/src/releases.js b/src/releases.js index 1414ca36..d0cf521c 100644 --- a/src/releases.js +++ b/src/releases.js @@ -11,7 +11,8 @@ export function parseReleases (commits, origin, packageVersion, options) { releases.push({ ...release, href: getCompareLink(commit.tag, release.tag || 'HEAD', origin), - commits: release.commits.sort(sortCommits) + commits: release.commits.sort(sortCommits), + major: semver.diff(commit.tag, release.tag) === 'major' }) } release = newRelease(commit.tag, commit.date) diff --git a/templates/compact.hbs b/templates/compact.hbs index 7051f7a8..eec1d741 100644 --- a/templates/compact.hbs +++ b/templates/compact.hbs @@ -5,7 +5,11 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). {{#each releases}} {{#if href}} - #### [{{title}}]({{href}}) + {{#if major}} + ### [{{title}}]({{href}}) + {{else}} + #### [{{title}}]({{href}}) + {{/if}} {{else}} #### {{title}} {{/if}} diff --git a/test/data/releases.js b/test/data/releases.js index 90c57aba..2945bf15 100644 --- a/test/data/releases.js +++ b/test/data/releases.js @@ -25,7 +25,8 @@ export default [ "title": "v0.1.0", "niceDate": "29 December 2015", "isoDate": "2015-12-29", - "href": "https://github.com/user/repo/compare/v0.0.2...v0.1.0" + "href": "https://github.com/user/repo/compare/v0.0.2...v0.1.0", + "major": false }, { "commits": [], @@ -72,7 +73,8 @@ export default [ "title": "v0.0.2", "niceDate": "28 December 2015", "isoDate": "2015-12-28", - "href": "https://github.com/user/repo/compare/v0.0.1...v0.0.2" + "href": "https://github.com/user/repo/compare/v0.0.1...v0.0.2", + "major": false }, { "commits": [ diff --git a/test/data/template-json.json b/test/data/template-json.json index 4d5fd90e..f3101ab3 100644 --- a/test/data/template-json.json +++ b/test/data/template-json.json @@ -25,7 +25,8 @@ "title": "v0.1.0", "niceDate": "29 December 2015", "isoDate": "2015-12-29", - "href": "https://github.com/user/repo/compare/v0.0.2...v0.1.0" + "href": "https://github.com/user/repo/compare/v0.0.2...v0.1.0", + "major": false }, { "commits": [], @@ -72,7 +73,8 @@ "title": "v0.0.2", "niceDate": "28 December 2015", "isoDate": "2015-12-28", - "href": "https://github.com/user/repo/compare/v0.0.1...v0.0.2" + "href": "https://github.com/user/repo/compare/v0.0.1...v0.0.2", + "major": false }, { "commits": [