From 2d7a79ef1c6cdd199cabaf8bd319028d19bc8de4 Mon Sep 17 00:00:00 2001 From: Ayo Date: Thu, 29 Sep 2022 21:09:39 +0200 Subject: [PATCH] feat: support account top languages (#3) --- src/GithubStats.astro | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/GithubStats.astro b/src/GithubStats.astro index 41bcad5..cffcef3 100644 --- a/src/GithubStats.astro +++ b/src/GithubStats.astro @@ -1,15 +1,20 @@ --- export interface Props { username: string; + topLanguages?: boolean; repo?: string; } -const { username, repo } = Astro.props; +const { username, repo, topLanguages } = Astro.props; const baseUrl = 'https://github-readme-stats.vercel.app/api/'; let url = `${baseUrl}?username=${username}`; if (repo) { url = `${baseUrl}/pin/?username=${username}&repo=${repo}`; } + +if (topLanguages) { + url = `${baseUrl}top-langs?username=${username}`; +} ---