feat: support account top languages (#3)
This commit is contained in:
parent
efda4f2cfb
commit
2d7a79ef1c
1 changed files with 6 additions and 1 deletions
|
@ -1,15 +1,20 @@
|
||||||
---
|
---
|
||||||
export interface Props {
|
export interface Props {
|
||||||
username: string;
|
username: string;
|
||||||
|
topLanguages?: boolean;
|
||||||
repo?: string;
|
repo?: string;
|
||||||
}
|
}
|
||||||
const { username, repo } = Astro.props;
|
const { username, repo, topLanguages } = Astro.props;
|
||||||
const baseUrl = 'https://github-readme-stats.vercel.app/api/';
|
const baseUrl = 'https://github-readme-stats.vercel.app/api/';
|
||||||
let url = `${baseUrl}?username=${username}`;
|
let url = `${baseUrl}?username=${username}`;
|
||||||
|
|
||||||
if (repo) {
|
if (repo) {
|
||||||
url = `${baseUrl}/pin/?username=${username}&repo=${repo}`;
|
url = `${baseUrl}/pin/?username=${username}&repo=${repo}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (topLanguages) {
|
||||||
|
url = `${baseUrl}top-langs?username=${username}`;
|
||||||
|
}
|
||||||
---
|
---
|
||||||
|
|
||||||
<img src={url} />
|
<img src={url} />
|
||||||
|
|
Loading…
Reference in a new issue