feat(editor): Get embed code label; numbered create-repo and README steps

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
shay
2026-11-30 13:05:05 -08:00
co-authored by Claude Opus 5.5
parent 01afeeda4e
commit 60ff6ac7df
3 changed files with 21 additions and 14 deletions
+2 -2
View File
@@ -41,7 +41,7 @@ That card is live, not a screenshot. Swap in your own username:
2. Sign in with GitHub. Signing in is how you prove ownership of the
username, and it unlocks the editor.
3. Pick a theme, reorder widgets, add any custom tags or achievements.
4. Click **Generate**.
4. Click **Get embed code**.
5. Paste this one line into your profile README:
```md
@@ -345,7 +345,7 @@ Sign in with GitHub at <https://gh-stats.com/api/>. Only the account whose
login matches the username can edit that widget's settings.
**Can I change the widget without re-embedding?**
Yes. The image URL is stable. Edit in the editor, click **Generate**,
Yes. The image URL is stable. Edit in the editor, click **Get embed code**,
and the next fetch serves the new version. GitHub's image cache may
delay propagation by a few minutes.
+18 -11
View File
@@ -173,6 +173,22 @@ export function ResultScreen({ username, generating, generatedSvg, generateError
</div>
<div className="w-full mt-8">
{noRepo === profileRepo && (
<div className="mb-6 rounded-xl ring-1 ring-gray-200 bg-white p-4">
<p className="text-sm text-gray-700 mb-3">
{username} has no profile README yet. GitHub shows the README of the repo named <code className="text-gray-600">{username}/{username}</code> on your profile.
</p>
<div className="flex flex-col sm:flex-row gap-2">
<a href={createRepoUrl} target="_blank" rel="noopener noreferrer" className="flex-1 text-center py-2.5 px-3 rounded-lg bg-gray-800 text-white text-sm hover:bg-gray-700 transition-colors">
1. Create {username}/{username}
</a>
<a href={addReadmeUrl} target="_blank" rel="noopener noreferrer" className="flex-1 text-center py-2.5 px-3 rounded-lg bg-gray-800 text-white text-sm hover:bg-gray-700 transition-colors">
2. Add the card to its README
</a>
</div>
<p className="mt-2 text-xs text-gray-500">In step 1, leave "Add a README" unticked. Step 2 opens a README with this card already in it; commit it.</p>
</div>
)}
<p className="text-xs uppercase tracking-wider text-gray-500 mb-2">Embed in your README</p>
<div className="relative">
<pre className="bg-gray-900 text-gray-100 text-xs p-4 pr-12 rounded-lg overflow-x-auto">
@@ -195,21 +211,12 @@ export function ResultScreen({ username, generating, generatedSvg, generateError
)}
</button>
</div>
<p className="mt-3 text-xs text-gray-500">
{noRepo !== profileRepo && <p className="mt-3 text-xs text-gray-500">
Paste it into <code className="text-gray-600">{username}/{username}</code>, the repo GitHub shows on your profile.{' '}
<a href={editReadmeUrl} onClick={copy} target="_blank" rel="noopener noreferrer" className="text-gray-700 underline hover:text-gray-900">Copy &amp; open your README</a>
{' \u00b7 '}
<a href={createRepoUrl} target="_blank" rel="noopener noreferrer" className="text-gray-700 underline hover:text-gray-900">Create the repo</a>
</p>
{noRepo === profileRepo && (
<p className="mt-2 text-xs text-gray-600">
{username} has no profile README yet. 1.{' '}
<a href={createRepoUrl} target="_blank" rel="noopener noreferrer" className="text-gray-800 underline hover:text-gray-900">Create the repo</a>
{' '}(leave "Add a README" unticked). 2.{' '}
<a href={addReadmeUrl} target="_blank" rel="noopener noreferrer" className="text-gray-800 underline hover:text-gray-900">Add a README with this card in it</a>
{' '}and commit.
</p>
)}
</p>}
{otherCard && (
<p className="mt-2 text-xs text-gray-600">
This README already shows a {otherCard} card. Replace that line with the one above to swap it for this card.
@@ -375,7 +375,7 @@ export function WorkshopScreen({
onClick={onGenerate}
className="w-full py-3 rounded-xl bg-gray-800 text-white text-sm font-medium hover:bg-gray-700 transition-colors mb-6"
>
Generate →
Get embed code →
</button>
{fetchError && (