Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ export function leaderboardPage(
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>${escapeHtml(heading)}</title>
<meta name="description" content="${escapeHtml(description)}">
<meta property="og:type" content="website">
<meta property="og:title" content="${escapeHtml(heading)}">
<meta property="og:description" content="${escapeHtml(description)}">
<meta property="og:image" content="${escapeHtml(links.image)}">
Expand Down
6 changes: 6 additions & 0 deletions test/page.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,12 @@ describe("leaderboardPage", () => {
expect(html).toContain('<link rel="icon" type="image/svg+xml" href="/favicon.svg">');
});

it("declares the leaderboard page as an Open Graph website", () => {
expect(html.match(/<meta property="og:type" content="[^"]+">/g)).toEqual([
'<meta property="og:type" content="website">',
]);
});

it("has the same share preview tags as a contributor page, pointing at its own image", () => {
expect(html).toContain('<meta property="og:image" content="https://bot.example/leaderboard/2026-10.png?v=abc">');
expect(html).toContain('<meta property="og:image:width" content="1200">');
Expand Down
Loading