Skip to content

Commit

Permalink
Own template
Browse files Browse the repository at this point in the history
CHANGELOG:
- commit ID after date
- reverse sorting
  • Loading branch information
HeikoTheissen committed Sep 26, 2021
1 parent b839f32 commit 3263262
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/changelog.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,17 @@ const fs = require("fs");
const path = require("path");
const commitPartial = fs.readFileSync(path.resolve(require.resolve("conventional-changelog-writer"), "../templates/commit.hbs"))
.toString()
.replace("* {{header}}\n\n{{~!-- commit link --}}", "### {{committerDate}}\n{{header}}\n\n");
.replace("* {{header}}", "### {{committerDate}}")
+ "{{header}}\n\n";

changelog(undefined, undefined, undefined, {
noteKeywords: ["CHANGELOG"]
}, {
commitsSort: function(a, b) {
if (a.committerDate < b.committerDate) return 1;
if (a.committerDate > b.committerDate) return -1;
return 0;
},
transform: function(commit, context) {
if (commit.notes.length === 1) {
commit.header = commit.notes[0].text;
Expand Down

0 comments on commit 3263262

Please sign in to comment.