Skip to content

[Docs Site] Merge WARP releases into changelog #22136

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: production
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions src/util/changelog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,32 @@ import rehypeFilterElements from "~/plugins/rehype/filter-elements";
import remarkGfm from "remark-gfm";
import rehypeRemark from "rehype-remark";
import remarkStringify from "remark-stringify";
import { marked } from "marked";

async function getWARPReleases(): Promise<Array<CollectionEntry<"changelog">>> {
const releases = await getCollection("warp-releases");

return releases.map((release) => {
const { platformName, version, releaseNotes, releaseDate } = release.data;
const title = `WARP client for ${platformName} (version ${version})`;

return {
id: release.id,
collection: "changelog",
body: releaseNotes,
data: {
title,
description: title,
hidden: false,
date: releaseDate,
products: [{ id: "zero-trust-warp", collection: "products" }],
},
rendered: {
html: marked.parse(releaseNotes, { async: false }),
},
};
});
}

export type GetChangelogsOptions = {
filter?: (entry: CollectionEntry<"changelog">) => boolean;
Expand Down Expand Up @@ -51,6 +77,8 @@ export async function getChangelogs({
}),
);

entries = entries.concat(await getWARPReleases());

if (filter) {
entries = entries.filter((e) => filter(e));
}
Expand Down
Loading