mirror of
https://github.com/ShayManor/github-readme-stats.git
synced 2026-12-02 11:53:48 +05:30
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:
@@ -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
|
2. Sign in with GitHub. Signing in is how you prove ownership of the
|
||||||
username, and it unlocks the editor.
|
username, and it unlocks the editor.
|
||||||
3. Pick a theme, reorder widgets, add any custom tags or achievements.
|
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:
|
5. Paste this one line into your profile README:
|
||||||
|
|
||||||
```md
|
```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.
|
login matches the username can edit that widget's settings.
|
||||||
|
|
||||||
**Can I change the widget without re-embedding?**
|
**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
|
and the next fetch serves the new version. GitHub's image cache may
|
||||||
delay propagation by a few minutes.
|
delay propagation by a few minutes.
|
||||||
|
|
||||||
|
|||||||
@@ -173,6 +173,22 @@ export function ResultScreen({ username, generating, generatedSvg, generateError
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="w-full mt-8">
|
<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>
|
<p className="text-xs uppercase tracking-wider text-gray-500 mb-2">Embed in your README</p>
|
||||||
<div className="relative">
|
<div className="relative">
|
||||||
<pre className="bg-gray-900 text-gray-100 text-xs p-4 pr-12 rounded-lg overflow-x-auto">
|
<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>
|
</button>
|
||||||
</div>
|
</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.{' '}
|
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 & open your README</a>
|
<a href={editReadmeUrl} onClick={copy} target="_blank" rel="noopener noreferrer" className="text-gray-700 underline hover:text-gray-900">Copy & open your README</a>
|
||||||
{' \u00b7 '}
|
{' \u00b7 '}
|
||||||
<a href={createRepoUrl} target="_blank" rel="noopener noreferrer" className="text-gray-700 underline hover:text-gray-900">Create the repo</a>
|
<a href={createRepoUrl} target="_blank" rel="noopener noreferrer" className="text-gray-700 underline hover:text-gray-900">Create the repo</a>
|
||||||
</p>
|
</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>
|
|
||||||
)}
|
|
||||||
{otherCard && (
|
{otherCard && (
|
||||||
<p className="mt-2 text-xs text-gray-600">
|
<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.
|
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}
|
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"
|
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>
|
</button>
|
||||||
|
|
||||||
{fetchError && (
|
{fetchError && (
|
||||||
|
|||||||
Reference in New Issue
Block a user