Skip to content

Commit d650a1c

Browse files
committed
better changelog id and add prefix link
1 parent a071a3f commit d650a1c

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

src/util/changelog.ts

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,23 @@ async function getWARPReleases(): Promise<Array<CollectionEntry<"changelog">>> {
2525
const { platformName, version, releaseNotes, releaseDate } = release.data;
2626
const title = `WARP client for ${platformName} (version ${version})`;
2727

28+
const [platform, track] = release.id.split("/");
29+
30+
const prettyTrack = track === "ga" ? "GA" : "Beta";
31+
const prettyPlatform =
32+
platform === "macos"
33+
? "macOS"
34+
: platform.charAt(0).toUpperCase() + platform.slice(1);
35+
36+
const link =
37+
track === "ga"
38+
? "[stable releases downloads page](/cloudflare-one/connections/connect-devices/warp/download-warp/)"
39+
: "[beta releases downloads page](/cloudflare-one/connections/connect-devices/warp/download-warp/beta-releases/)";
40+
41+
const prefix = `A new ${prettyTrack} release for the ${prettyPlatform} WARP client is now available on the ${link}.`;
42+
2843
return {
29-
id: release.id,
44+
id: `${releaseDate.toISOString().slice(0, 10)}-warp-${platform}-${track}`,
3045
collection: "changelog",
3146
body: releaseNotes,
3247
data: {
@@ -37,7 +52,9 @@ async function getWARPReleases(): Promise<Array<CollectionEntry<"changelog">>> {
3752
products: [{ id: "zero-trust-warp", collection: "products" }],
3853
},
3954
rendered: {
40-
html: marked.parse(releaseNotes, { async: false }),
55+
html: marked.parse([prefix, releaseNotes].join("\n\n"), {
56+
async: false,
57+
}),
4158
},
4259
};
4360
});

0 commit comments

Comments
 (0)