-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(docs): add contributors list to home page (#45)
- Loading branch information
1 parent
e645742
commit ee52e68
Showing
3 changed files
with
54 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) && | ||
<section class="text-emphasis body-font" id="contributors"> | ||
<div class="container px-5 py-24 mx-auto flex-col flex-wrap"> | ||
<SectionTitle> Contributors </SectionTitle> | ||
<p class="max-w-[20rem] text-center mx-auto mt-4">Would you like to help contribute? Check out some of the open <a href="https://github.com/Vexilla/vexilla/issues" target="_blank" class="always-underline">Issues on GitHub</a>.</p> | ||
<SectionHr /> | ||
<div class="flex items-center justify-center gap-2"> | ||
{contributors.map(contributor => | ||
<a href={contributor.html_url} target="_blank"> | ||
<img src={contributor.avatar_url} class="rounded-full w-16" /> | ||
</a>)} | ||
</div> | ||
</div> | ||
</section> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} |