Skip to content

Commit

Permalink
Slightly larger heading for major releases
Browse files Browse the repository at this point in the history
  • Loading branch information
cookpete committed Nov 24, 2017
1 parent d82e81c commit d618f01
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
3 changes: 2 additions & 1 deletion src/releases.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 5 additions & 1 deletion templates/compact.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
Expand Down
6 changes: 4 additions & 2 deletions test/data/releases.js
Original file line number Diff line number Diff line change
Expand Up @@ -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": [],
Expand Down Expand Up @@ -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": [
Expand Down
6 changes: 4 additions & 2 deletions test/data/template-json.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [],
Expand Down Expand Up @@ -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": [
Expand Down

0 comments on commit d618f01

Please sign in to comment.