Skip to content

Commit

Permalink
[feat]: add release contributors
Browse files Browse the repository at this point in the history
  • Loading branch information
stone1100 committed Jun 27, 2024
1 parent 4db5979 commit cab6377
Show file tree
Hide file tree
Showing 6 changed files with 2,537 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/components/CodeBlock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ under the License.
*/
import clsx from "clsx";
import React, { useEffect, useState } from "react";
import { getHighlighter } from "shiki";
import { getSingletonHighlighter } from "shiki";
// eslint-disable-next-line @typescript-eslint/no-explicit-any
let shikiHighlighter: any = null;

const highlightCode = async (code: string, lang: string) => {
if (!shikiHighlighter) {
shikiHighlighter = await getHighlighter({
shikiHighlighter = await getSingletonHighlighter({
themes: ["material-theme-lighter", "catppuccin-macchiato"],
langs: ["sh", "sql"],
});
Expand Down
21 changes: 21 additions & 0 deletions src/components/ReleaseNotes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,27 @@ export const ReleaseNotes = (props: { releases?: ReleaseInfo[] }) => {
<div key={release.name} className="italic">
<MDXRemote {...release.mdxBody} />
</div>
{release.contributors && release.contributors.length > 0 && (
<div>
<h3 className="italic">🍻 Contributors</h3>
<div className="flex gap-1">
{release.contributors.map((c) => (
<Link
href={c.html_url}
key={c.login}
className="m-0 flex flex-col items-center border-0"
>
<img
src={c.avatar_url}
className="m-0 size-8 rounded-full leading-8"
title={c.login}
alt={c.login}
/>
</Link>
))}
</div>
</div>
)}

<div>
<h3 className="italic">📦 Packages downloads</h3>
Expand Down
5 changes: 5 additions & 0 deletions src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,9 @@ export interface ReleaseInfo {
size: number;
browser_download_url: string;
}[];
contributors: {
login: string;
html_url: string;
avatar_url: string;
}[];
}
Loading

0 comments on commit cab6377

Please sign in to comment.