Skip to content

Commit a6cfb5f

Browse files
committed
fix: Correctly identify version number for changelog link in footer
1 parent a32535e commit a6cfb5f

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

assets/styles/styles.css

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,15 @@ main.changelog * {
280280
text-transform: none;
281281
}
282282

283+
main.changelog h1,
284+
main.changelog h2,
285+
main.changelog h3,
286+
main.changelog h4,
287+
main.changelog h5,
288+
main.changelog h6 {
289+
padding-bottom: 20px !important;
290+
}
291+
283292
main.changelog a {
284293
color: #333;
285294
border-bottom: 1px solid #333;

scripts/generateChangelog.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,12 @@ changelogHtmlContent = changelogHtmlContent.replace(
2121
fs.writeFileSync(CHANGELOG_HTML_LOCATION, changelogHtmlContent, "utf8");
2222

2323
const versionMatch = changelogMdContent.match(
24-
/## ((0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(-(0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(\.(0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*)?(\+[0-9a-zA-Z-]+(\.[0-9a-zA-Z-]+)*)?)/
24+
/(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(-(0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(\.(0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*)?(\+[0-9a-zA-Z-]+(\.[0-9a-zA-Z-]+)*)?/
2525
);
2626

27-
const version =
28-
versionMatch && versionMatch.length > 2 ? versionMatch[1] : "ER.RO.R";
27+
const version = versionMatch ? versionMatch[0] : "ER.RO.R";
28+
29+
console.log(`Found version v${version}`);
2930

3031
const pages = findInDir("./public", ".html");
3132

@@ -34,4 +35,6 @@ pages.forEach((page) => {
3435
fs.writeFileSync(page, pageContent.replace("{version}", version), "utf8");
3536
});
3637

38+
console.log(`Updated ${pages.length} with correct version changelog link`);
39+
3740
console.log("/// Finished changelog generation");

0 commit comments

Comments
 (0)