From 2781edec0a46013e0eebc38a6f5b977dd8ba6402 Mon Sep 17 00:00:00 2001 From: Ayo Date: Fri, 30 Sep 2022 23:03:55 +0200 Subject: [PATCH] feat: support account card with icons --- README.md | 16 ++++++++++++---- src/GithubStats.astro | 5 +++-- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 1464df2..f76ce06 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ Embed GitHub stats on your [Astro](https://astro.build) page ✨ Features: -1. Embed GitHub Account stats +1. Embed GitHub Account stats (with or without icons) 1. Embed GitHub Account top languages 1. Embed GitHub Repositories info with stars @@ -28,13 +28,16 @@ Then use on your Astro page: import GithubStats from 'astro-github-stats'; --- - + - + + + + - + ``` @@ -44,6 +47,11 @@ Example Account Card: ![screenshot](https://raw.githubusercontent.com/ayoayco/astro-github-stats/main/assets/screenshot.png) +Example Account Card with Icons: + +Screen Shot 2022-09-30 at 10 59 39 PM + + Example Account Top Languages: Screen Shot 2022-09-29 at 9 09 05 PM diff --git a/src/GithubStats.astro b/src/GithubStats.astro index cffcef3..2fb7292 100644 --- a/src/GithubStats.astro +++ b/src/GithubStats.astro @@ -3,10 +3,11 @@ export interface Props { username: string; topLanguages?: boolean; repo?: string; + showIcons?: boolean; } -const { username, repo, topLanguages } = Astro.props; +const { username, repo, topLanguages, showIcons } = Astro.props; const baseUrl = 'https://github-readme-stats.vercel.app/api/'; -let url = `${baseUrl}?username=${username}`; +let url = `${baseUrl}?username=${username}&show_icons=${!!showIcons}`; if (repo) { url = `${baseUrl}/pin/?username=${username}&repo=${repo}`;