astro-github-stats/src/GithubStats.astro
2022-09-27 15:46:41 +02:00

15 lines
312 B
Text

---
export interface Props {
username: string;
repo?: string;
}
const { username, repo } = 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}`;
}
---
<img src={url} />