Skip to content

Commit 3f6567a

Browse files
committed
fix: use actual repo URL in card embed snippet instead of placeholder
Pass GITHUB_REPOSITORY env var through render to index page template. Action environment provides this automatically. Falls back to {username}/{repo} placeholder when not available.
1 parent 2e0c557 commit 3f6567a

5 files changed

Lines changed: 8 additions & 3 deletions

File tree

src/cli/commands/render.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,12 +194,15 @@ const run = async (options: RenderOptions): Promise<void> => {
194194

195195
// Write index page with titles from each week's LLM data
196196
const entries = await buildReportEntries(options.dataDir, allPaths);
197+
const ghRepo = env("GITHUB_REPOSITORY");
198+
const repoUrl = ghRepo ? `https://github.com/${ghRepo}` : undefined;
197199
const indexHtml = renderIndexPage(
198200
entries,
199201
{ username: githubData.username, avatarUrl: githubData.avatarUrl, profile: githubData.profile },
200202
options.language,
201203
options.siteTitle,
202204
base,
205+
repoUrl,
203206
options.theme,
204207
);
205208
const indexPath = join(options.outputDir, "index.html");

src/deployer/index-page.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ export const renderIndexPage = (
5858
language: Language = "en",
5959
siteTitle?: string,
6060
baseUrl?: string,
61+
repoUrl?: string,
6162
themeName: Theme = "brutalist",
6263
): string => {
6364
const locale = getLocale(language);
@@ -83,6 +84,7 @@ export const renderIndexPage = (
8384
description,
8485
ogImageUrl,
8586
baseUrl,
87+
repoUrl,
8688
lang: language,
8789
weeklyReports: locale.weeklyReports,
8890
poweredBy: locale.poweredBy,

src/renderer/themes/brutalist/templates/index-page.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@
9999
{{#if baseUrl}}
100100
<div class="embed-section">
101101
<div class="embed-label">Embed in your GitHub README</div>
102-
<pre class="embed-snippet"><code>&lt;a href="https://github.com/{your-repo}"&gt;
102+
<pre class="embed-snippet"><code>&lt;a href="{{#if repoUrl}}{{repoUrl}}{{else}}https://github.com/{username}/{repo}{{/if}}"&gt;
103103
&lt;picture&gt;
104104
&lt;source media="(prefers-color-scheme: dark)" srcset="{{baseUrl}}/card-dark.svg" /&gt;
105105
&lt;source media="(prefers-color-scheme: light)" srcset="{{baseUrl}}/card.svg" /&gt;

src/renderer/themes/editorial/templates/index-page.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
{{#if baseUrl}}
6565
<div class="embed-section">
6666
<div class="embed-label">Embed in your GitHub README</div>
67-
<pre class="embed-snippet"><code>&lt;a href="https://github.com/{your-repo}"&gt;
67+
<pre class="embed-snippet"><code>&lt;a href="{{#if repoUrl}}{{repoUrl}}{{else}}https://github.com/{username}/{repo}{{/if}}"&gt;
6868
&lt;picture&gt;
6969
&lt;source media="(prefers-color-scheme: dark)" srcset="{{baseUrl}}/card-dark.svg" /&gt;
7070
&lt;source media="(prefers-color-scheme: light)" srcset="{{baseUrl}}/card.svg" /&gt;

src/renderer/themes/minimal/templates/index-page.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
{{#if baseUrl}}
6565
<div class="embed-section">
6666
<div class="embed-label">Embed in your GitHub README</div>
67-
<pre class="embed-snippet"><code>&lt;a href="https://github.com/{your-repo}"&gt;
67+
<pre class="embed-snippet"><code>&lt;a href="{{#if repoUrl}}{{repoUrl}}{{else}}https://github.com/{username}/{repo}{{/if}}"&gt;
6868
&lt;picture&gt;
6969
&lt;source media="(prefers-color-scheme: dark)" srcset="{{baseUrl}}/card-dark.svg" /&gt;
7070
&lt;source media="(prefers-color-scheme: light)" srcset="{{baseUrl}}/card.svg" /&gt;

0 commit comments

Comments
 (0)