diff --git a/apps/docs/src/components/ContributorsList.astro b/apps/docs/src/components/ContributorsList.astro new file mode 100644 index 0000000..c75033b --- /dev/null +++ b/apps/docs/src/components/ContributorsList.astro @@ -0,0 +1,31 @@ +--- + +import type {Contributor} from "@/types/github"; +import SectionHr from "./home/common/section-hr.astro"; +import SectionTitle from "./home/common/section-title.astro"; + + +let contributors: Contributor[] = []; + +const contributorsResponse = await fetch("https://api.github.com/repos/Vexilla/vexilla/contributors"); +if (contributorsResponse.ok) { + contributors = await contributorsResponse.json() +} + +--- + +{Boolean(contributors.length) && +
+
+ Contributors +

Would you like to help contribute? Check out some of the open Issues on GitHub.

+ +
+ {contributors.map(contributor => + + + )} +
+
+
+} diff --git a/apps/docs/src/pages/index.astro b/apps/docs/src/pages/index.astro index 7f4bf5c..0172341 100644 --- a/apps/docs/src/pages/index.astro +++ b/apps/docs/src/pages/index.astro @@ -7,6 +7,7 @@ import HomeFeatures from "../components/home/features.astro"; import HomeDocumentation from "../components/home/documentation.astro"; import HomeHelp from "../components/home/help.astro"; import HomeServices from "../components/home/services.astro"; +import ContributorsList from "@/components/ContributorsList.astro"; --- @@ -18,5 +19,6 @@ import HomeServices from "../components/home/services.astro"; + diff --git a/apps/docs/src/types/github.ts b/apps/docs/src/types/github.ts new file mode 100644 index 0000000..e250e23 --- /dev/null +++ b/apps/docs/src/types/github.ts @@ -0,0 +1,21 @@ +export interface Contributor { + login: string; + id: number; + node_id: string; + avatar_url: string; + gravatar_id: string; + url: string; + html_url: string; + followers_url: string; + following_url: string; + gists_url: string; + starred_url: string; + subscriptions_url: string; + organizations_url: string; + repos_url: string; + events_url: string; + received_events_url: string; + type: string; + site_admin: boolean; + contributions: number; +}