diff --git a/README.md b/README.md index aa4cf5d..e141779 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ and earns you tags like `Backend`, `ML`, or `Founder #42`. That card is live, not a screenshot. Swap in your own username: ```md -![my stats](https://gh-stats.com/api/YOUR_USERNAME) +[![my stats](https://gh-stats.com/api/YOUR_USERNAME)](https://gh-stats.com) ``` composite widget, midnight theme @@ -45,7 +45,7 @@ That card is live, not a screenshot. Swap in your own username: 5. Paste this one line into your profile README: ```md - ![my stats](https://gh-stats.com/api/YOUR_USERNAME) + [![my stats](https://gh-stats.com/api/YOUR_USERNAME)](https://gh-stats.com) ``` The image URL is stable. Once it's in your README you can change diff --git a/generator/frontend/public/github-profile-readme.html b/generator/frontend/public/github-profile-readme.html new file mode 100644 index 0000000..1787542 --- /dev/null +++ b/generator/frontend/public/github-profile-readme.html @@ -0,0 +1,189 @@ + + + + + +How to create a GitHub profile README (and add a stats card) + + + + + + + + + + + + + + + + + +
+ +

How to create a GitHub profile README

+ +

+ A profile README is the block of text and images at the top of your GitHub profile + page. GitHub builds it from one specific repository, so setting it up is a matter of + creating that repository and writing a README in it. +

+ +

What GitHub needs

+ +

GitHub shows a README on your profile when all four of these hold:

+ +
+ + + + + + +
RequirementExample for the username octocat
A repository named exactly like your usernameoctocat/octocat
The repository is publicVisibility: Public
A file named README.md in its rootoctocat/octocat/README.md
The file is not emptyAny text at all
+
+ +

Create it in five steps

+ +

+ 1. Open github.com/new.
+ 2. Under Repository name, type your username exactly. GitHub confirms with a + note that this is a special repository.
+ 3. Select Public.
+ 4. Turn on Add a README file.
+ 5. Click Create repository, then Edit README. +

+ +

+ Save any text and your profile page shows it. The pre-filled template is fine to + keep, replace, or delete. +

+ +

+ If you made a public repository with your username before July 2020, GitHub does + not show it automatically. Open the repository and click Share to + profile. +

+ +

Add a stats card

+ +

+ Paste this line into the README, replace the username in both places, and commit: +

+ +
[![GitHub stats](https://gh-stats.com/api/YOUR_USERNAME)](https://gh-stats.com)
+ +

+ It renders one card with a score out of 100, your contribution timeline, top + collaborators, language breakdown and commit streaks, and it updates on its own. + The first request for a new username queues a build, so give it a minute. +

+ +
+
+ A gh-stats card: profile score, impact timeline, collaborators, languages, streaks and achievements. +
+
A stats card in a profile README, cropped.
+
+ + Preview the card for your username + +

+ Want only one part? The + top languages card + works the same way. Already using github-readme-stats? See the + migration guide. +

+ +

Common questions

+ +

+ I created the repository but my profile shows nothing. Check the + four requirements above. The usual cause is a private repository or a name that does + not match the username exactly. +

+ +

+ Can I edit it later? Yes. Every commit to that README.md + updates your profile page. +

+ +

+ Does the card need a token or an account? No. It reads public + GitHub activity only, and there is nothing to sign up for. +

+ + + +
+ + diff --git a/generator/frontend/public/github-top-languages-card.html b/generator/frontend/public/github-top-languages-card.html new file mode 100644 index 0000000..4befc68 --- /dev/null +++ b/generator/frontend/public/github-top-languages-card.html @@ -0,0 +1,188 @@ + + + + + +GitHub top languages card for your profile README + + + + + + + + + + + + + + + + + +
+ +

A top languages card for your GitHub profile README

+ +

+ The languages card shows which languages your public repositories are written in, + as a donut and a ranked legend. It is one image, served from one URL, and it stays + current without a GitHub Action or a token. +

+ +
+ A gh-stats top languages card: a donut chart with Python, Go, Jupyter Notebook, JavaScript and TypeScript, each with a percentage. +
The languages card for one profile.
+
+ +

Add it to your README

+ +

Paste this into your profile README and replace the username:

+ +
![Top languages](https://gh-stats.com/api/YOUR_USERNAME?widgets=languages)
+ +

+ The first request for a new username queues a build, so the card can take a minute + to fill in. After that it is served from cache and refreshed in the background. +

+ + Preview it on your username + +

Hide languages and pick a theme

+ +

+ Notebooks, generated HTML and vendored code often dominate a languages chart. + List what to leave out in hide, comma-separated, and choose a look + with theme: +

+ +
![Top languages](https://gh-stats.com/api/YOUR_USERNAME?widgets=languages&hide=Jupyter%20Notebook,HTML&theme=nord)
+ +
+ + + + + + +
ParameterWhat it does
hideLanguages to exclude, comma-separated. Use %20 for spaces.
themeclean, midnight, nord, onyx or paper.
+
+ +

Coming from github-readme-stats

+ +

+ If your README already has a top-langs card from + github-readme-stats.vercel.app, change only the domain: +

+ +
+ + + + +
Your current URLChange it to
github-readme-stats.vercel.app/api/top-langs?username=Ugh-stats.com/api/top-langs?username=U
+
+ +

+ The compatibility URL ignores the original styling parameters (layout, + langs_count, colours) and serves the default card. Use the + ?widgets=languages form above for hide and theme. +

+ +

+ The full migration guide covers the stats and streak cards too: + github-readme-stats alternative. +

+ +

Common questions

+ +

+ How are percentages worked out? From the byte counts GitHub reports + for each public repository you authored, summed across those repositories. Forks are + left out. A large repository in one language weighs more than several small ones. +

+ +

+ Are private repositories counted? No. Only public activity is + visible to the fetcher. +

+ +

+ Can I show it alongside other stats? Yes. Drop the + ?widgets=languages part and the same URL serves the full profile card: + score, contribution timeline, collaborators, languages and streaks in one image. +

+ + + +
+ + diff --git a/generator/frontend/public/sitemap.xml b/generator/frontend/public/sitemap.xml index 4fc2414..6bfb5bc 100644 --- a/generator/frontend/public/sitemap.xml +++ b/generator/frontend/public/sitemap.xml @@ -10,4 +10,14 @@ monthly 0.8 + + https://gh-stats.com/github-top-languages-card.html + monthly + 0.8 + + + https://gh-stats.com/github-profile-readme.html + monthly + 0.8 + diff --git a/generator/frontend/src/screens/ResultScreen.tsx b/generator/frontend/src/screens/ResultScreen.tsx index ff567ac..15b7a9e 100644 --- a/generator/frontend/src/screens/ResultScreen.tsx +++ b/generator/frontend/src/screens/ResultScreen.tsx @@ -156,7 +156,7 @@ export function ResultScreen({ username, generating, generatedSvg, generateError

Paste it into {username}/{username}, the repo GitHub shows on your profile.{' '} - Open your README + Copy & open your README {' \u00b7 '} Create the repo

diff --git a/generator/src/widgets/composite.py b/generator/src/widgets/composite.py index 349b8d2..8de62e1 100644 --- a/generator/src/widgets/composite.py +++ b/generator/src/widgets/composite.py @@ -125,7 +125,9 @@ def compose_widget( fill="none" stroke="{t["card_border"]}" stroke-width="1"/> {header} {embedded} + Generated with gh-stats.com + '''