diff --git a/generator/frontend/public/github-profile-readme.html b/generator/frontend/public/github-profile-readme.html index 1787542..8a21567 100644 --- a/generator/frontend/public/github-profile-readme.html +++ b/generator/frontend/public/github-profile-readme.html @@ -156,7 +156,8 @@

Want only one part? The top languages card - works the same way. Already using github-readme-stats? See the + works the same way, and there are five + themes to pick from. Already using github-readme-stats? See the migration guide.

diff --git a/generator/frontend/public/github-profile-trophy-alternative.html b/generator/frontend/public/github-profile-trophy-alternative.html new file mode 100644 index 0000000..c0be5af --- /dev/null +++ b/generator/frontend/public/github-profile-trophy-alternative.html @@ -0,0 +1,177 @@ + + + + + +github-profile-trophy not loading (402)? Two fixes + + + + + + + + + + + + + + + + + +
+ +

github-profile-trophy not loading?

+ +

+ The public instance at github-profile-trophy.vercel.app returns + 402 Payment required (Vercel's DEPLOYMENT_DISABLED), so every + README that embeds it shows a broken image. There are two ways to fix it: run your own + copy, or switch to a different card. +

+ +

Is yours broken?

+ +

Open your profile. If the trophies are a broken-image icon or alt text, your README + points at the disabled instance. The line looks like this:

+ +
[![trophy](https://github-profile-trophy.vercel.app/?username=YOUR_USERNAME)](https://github.com/ryo-ma/github-profile-trophy)
+ +

Fix 1: host your own copy

+ +

+ The project is open source and its README asks users to fork it and deploy the fork to + Vercel, then point the image at the new address. Its README also lists volunteer + mirrors, but most of them returned errors when this page was written (November 2026), + so a mirror may break again. +

+ +

Fix 2: a rank card, in one line

+ +

To switch to gh-stats instead, replace the line with this one, change the username, and commit:

+ +
[![GitHub rank](https://gh-stats.com/api/YOUR_USERNAME/grade.svg)](https://gh-stats.com)
+ +
+ gh-stats grade card: a letter rank, a score out of 100, and commit, PR, star, repo and follower counts. +
The grade card for torvalds, rendered live.
+
+ +

+ There is no token to create, no signup and nothing to deploy. The first request for a + new username queues a build, so the image can take a minute to appear. +

+ +

How it differs

+ +
+ + + + + +
github-profile-trophygh-stats grade card
ShowsA row of trophies, each with its own rankOne overall rank and score, plus commits, PRs, stars, repos and followers
ExtrasMany themes, row and column layoutRole tags worked out from your repos; five themes
HostingPublic instance returns 402; self-host on Vercelgh-stats.com, or self-host (MIT)
+
+ +

Want the whole profile?

+ +

+ Drop the /grade.svg and the same URL renders one card with the rank, a + contribution timeline, top collaborators, languages and streaks: +

+ +
[![GitHub stats](https://gh-stats.com/api/YOUR_USERNAME)](https://gh-stats.com)
+ + Preview it for your username + +

+ See the five themes, or + how to create a profile README + if you do not have one yet. +

+ +

Common questions

+ +

+ Does gh-stats need access to my account? No. It reads public GitHub + activity only. +

+ + + +
+ + diff --git a/generator/frontend/public/github-readme-activity-graph-alternative.html b/generator/frontend/public/github-readme-activity-graph-alternative.html new file mode 100644 index 0000000..a914d54 --- /dev/null +++ b/generator/frontend/public/github-readme-activity-graph-alternative.html @@ -0,0 +1,185 @@ + + + + + +github-readme-activity-graph not loading (402)? Two fixes + + + + + + + + + + + + + + + + + +
+ +

github-readme-activity-graph not loading?

+ +

+ The old github-readme-activity-graph address on vercel.app has returned + 402 Payment required (Vercel's DEPLOYMENT_DISABLED) since + September 2026, so READMEs that still use it show a broken image. There are two ways + to fix it: point at the project's new address, or switch to a different graph. +

+ +

Is yours broken?

+ +

Open your profile. If the graph is a broken-image icon or alt text, your README points at + the disabled instance. The line looks like this:

+ +
![Activity graph](https://github-readme-activity-graph.vercel.app/graph?username=YOUR_USERNAME)
+ +

Fix 1: the project's new address

+ +

The project now runs on Cloudflare Workers. Change the domain and keep everything else:

+ +
https://github-readme-activity-graph.ashutosh-dwivedi0710.workers.dev/graph?username=YOUR_USERNAME
+ +

Fix 2: a different graph, in one line

+ +

To switch to gh-stats instead, replace the line with this one, change the username, and commit:

+ +
[![Contribution graph](https://gh-stats.com/api/YOUR_USERNAME/impact.svg)](https://gh-stats.com)
+ +
+ gh-stats impact timeline: weekly contributions over the last six months. +
The impact timeline for torvalds, rendered live.
+
+ +

+ There is no token to create and no signup. The first request for a new username queues + a build, so the image can take a minute to appear. +

+ +

How it differs

+ +
+ + + + + + +
github-readme-activity-graphgh-stats impact timeline
WindowLast 31 days by default (up to 90), one point per dayLast six months, one point per week
CountsDaily contributionsWeekly totals from your contribution calendar
ThemesMany, plus custom colours and titleFive: ?theme=midnight, onyx, nord, clean, paper
AddressMoved from vercel.app to workers.devgh-stats.com
+
+ +

+ A weekly line over six months is smoother than a daily one. It shows the shape of your + year, and a quiet weekend does not read as a gap. +

+ +

Want the whole profile?

+ +

+ Drop the /impact.svg and the same URL renders one card with a score out of + 100, the timeline, top collaborators, languages and streaks: +

+ +
[![GitHub stats](https://gh-stats.com/api/YOUR_USERNAME)](https://gh-stats.com)
+ + Preview it for your username + +

+ See the five themes, or + how to create a profile README + if you do not have one yet. +

+ +

Common questions

+ +

+ Can I keep using github-readme-activity-graph? Yes. Use Fix 1; the + project is maintained and only its old vercel.app address is disabled. +

+ +

+ Does gh-stats need access to my account? No. It reads public GitHub + activity only. +

+ + + +
+ + diff --git a/generator/frontend/public/github-readme-themes.html b/generator/frontend/public/github-readme-themes.html new file mode 100644 index 0000000..69dcaf4 --- /dev/null +++ b/generator/frontend/public/github-readme-themes.html @@ -0,0 +1,193 @@ + + + + + +GitHub README stats card themes: dark, light and auto-switching + + + + + + + + + + + + + + + + + +
+ +

Stats card themes for your GitHub profile README

+ +

+ A gh-stats card takes one theme parameter. Pick one of five, or serve a dark + card to dark-mode visitors and a light one to everyone else. +

+ +

The five themes

+ +
+
+

midnight

+
gh-stats card in the midnight theme
+

Dark slate. The default look.

+
?theme=midnight
+
+
+

onyx

+
gh-stats card in the onyx theme
+

High-contrast neon on pure black.

+
?theme=onyx
+
+
+

nord

+
gh-stats card in the nord theme
+

Muted pastels on slate blue.

+
?theme=nord
+
+
+

clean

+
gh-stats card in the clean theme
+

White, for light-mode profiles.

+
?theme=clean
+
+
+

paper

+
gh-stats card in the paper theme
+

Warm off-white.

+
?theme=paper
+
+
+ +

Use a theme

+ +

Add ?theme= to the card URL in your README, replace the username, and commit:

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

Leave the parameter out and the card uses midnight.

+ +

Switch with the viewer's GitHub theme

+ +

+ GitHub renders <picture> in READMEs and honours + prefers-color-scheme, so each visitor sees the card that matches their + GitHub appearance setting: +

+ +
<a href="https://gh-stats.com">
+  <picture>
+    <source media="(prefers-color-scheme: dark)"
+            srcset="https://gh-stats.com/api/YOUR_USERNAME?theme=onyx"/>
+    <source media="(prefers-color-scheme: light)"
+            srcset="https://gh-stats.com/api/YOUR_USERNAME?theme=clean"/>
+    <img alt="GitHub stats" src="https://gh-stats.com/api/YOUR_USERNAME?theme=clean"/>
+  </picture>
+</a>
+ +

Any dark theme works in the first line and any light one in the second.

+ + Preview every theme with your username + +

+ New to profile READMEs? Start with + how to create one. + Coming from github-readme-stats? See the + migration guide. +

+ +

Common questions

+ +

+ Can I make a theme the default without the parameter? Yes. Sign in on + gh-stats.com with the GitHub account the card belongs + to, pick the theme, and save. /api/YOUR_USERNAME then uses it. +

+ +

+ Does changing the theme reset my card? No. The theme changes colours + only; the data is the same. +

+ + + +
+ + diff --git a/generator/frontend/public/sitemap.xml b/generator/frontend/public/sitemap.xml index 6bfb5bc..d1a708b 100644 --- a/generator/frontend/public/sitemap.xml +++ b/generator/frontend/public/sitemap.xml @@ -20,4 +20,19 @@ monthly 0.8 + + https://gh-stats.com/github-readme-themes.html + monthly + 0.8 + + + https://gh-stats.com/github-readme-activity-graph-alternative.html + monthly + 0.8 + + + https://gh-stats.com/github-profile-trophy-alternative.html + monthly + 0.8 + diff --git a/generator/frontend/src/screens/ResultScreen.tsx b/generator/frontend/src/screens/ResultScreen.tsx index 15b7a9e..e849f83 100644 --- a/generator/frontend/src/screens/ResultScreen.tsx +++ b/generator/frontend/src/screens/ResultScreen.tsx @@ -1,5 +1,16 @@ import DOMPurify from 'dompurify' -import { useMemo, useState } from 'react' +import { useEffect, useMemo, useState } from 'react' + +// Stats cards people already have in their profile README. A visitor who has +// one needs "replace that line", not "paste this somewhere". +const OTHER_CARDS: [RegExp, string][] = [ + [/github-readme-stats/i, 'github-readme-stats'], + [/streak-stats|readme-streak/i, 'GitHub Readme Streak Stats'], + [/github-stats-extended/i, 'github-stats-extended'], + [/github-profile-summary-cards/i, 'github-profile-summary-cards'], + [/github-profile-trophy/i, 'github-profile-trophy'], + [/github-readme-activity-graph/i, 'github-readme-activity-graph'], +] function sanitizeSvg(raw: string): string { return DOMPurify.sanitize(raw, { @@ -40,6 +51,36 @@ export function ResultScreen({ username, generating, generatedSvg, generateError const profileRepo = encodeURIComponent(username) const editReadmeUrl = `https://github.com/${profileRepo}/${profileRepo}/edit/HEAD/README.md` const createRepoUrl = `https://github.com/new?name=${profileRepo}&description=${encodeURIComponent('My GitHub profile')}&visibility=public` + // raw.githubusercontent.com sends Access-Control-Allow-Origin: *, so the + // browser can read the profile README directly. Any failure leaves the + // generic hint in place. + const [found, setFound] = useState<{ repo: string; card: string } | null>(null) + const otherCard = found?.repo === profileRepo ? found.card : null + // No profile repo at all: GitHub's new-file page takes ?filename=&value=, so + // after creating the (empty) repo one click opens a README with the card in it. + const [noRepo, setNoRepo] = useState(null) + const addReadmeUrl = `https://github.com/${profileRepo}/${profileRepo}/new/main?filename=README.md&value=${encodeURIComponent(embedSnippet + '\n')}` + useEffect(() => { + let live = true + fetch(`https://raw.githubusercontent.com/${profileRepo}/${profileRepo}/HEAD/README.md`) + .then(r => { + // A 404 here can also mean readme.md in another case, so only the + // API's 404 for the repo itself counts as "no repo". + if (r.status === 404) { + fetch(`https://api.github.com/repos/${profileRepo}/${profileRepo}`) + .then(a => { if (live && a.status === 404) setNoRepo(profileRepo) }) + .catch(() => {}) + } + return r.ok ? r.text() : '' + }) + .then(text => { + if (!live || /gh-stats\.com/i.test(text)) return + const hit = OTHER_CARDS.find(([re]) => re.test(text)) + if (hit) setFound({ repo: profileRepo, card: hit[1] }) + }) + .catch(() => {}) + return () => { live = false } + }, [profileRepo]) const copy = async () => { try { @@ -160,6 +201,20 @@ export function ResultScreen({ username, generating, generatedSvg, generateError {' \u00b7 '} Create the repo

+ {noRepo === profileRepo && ( +

+ {username} has no profile README yet. 1.{' '} + Create the repo + {' '}(leave "Add a README" unticked). 2.{' '} + Add a README with this card in it + {' '}and commit. +

+ )} + {otherCard && ( +

+ This README already shows a {otherCard} card. Replace that line with the one above to swap it for this card. +

+ )} )}