Simplify embed to single info line

This commit is contained in:
CallMeVerity
2026-06-04 23:21:13 +01:00
parent 05ec655a28
commit 6ec5ebada5
+3 -13
View File
@@ -28,19 +28,15 @@ function pageTitle(video: VideoEntry): string {
}
function ogTitle(video: VideoEntry): string {
return mapDisplayName(video.mapName);
}
function ogDescription(video: VideoEntry): string {
const parts: string[] = [formatRunTime(video.runTime)];
const parts: string[] = [mapDisplayName(video.mapName)];
if (video.tier != null) parts.push(`Tier ${video.tier}`);
parts.push(formatRunTime(video.runTime));
return parts.join(" · ");
}
function buildOgsHtml(video: VideoEntry): string {
const runUrl = `${BASE_URL}/run/${video.id}`;
const title = ogTitle(video);
const description = ogDescription(video);
const oembedUrl = `${BASE_URL}/api/oembed/${video.id}`;
const thumbnailUrl = video.thumbnailKey
@@ -51,7 +47,6 @@ function buildOgsHtml(video: VideoEntry): string {
let tags =
` <link rel="alternate" type="application/json+oembed" href="${escapeHtml(oembedUrl)}" title="${escapeHtml(title)}" />\n` +
` <meta property="og:title" content="${escapeHtml(title)}" />\n` +
` <meta property="og:description" content="${escapeHtml(description)}" />\n` +
` <meta property="og:url" content="${runUrl}" />\n` +
` <meta property="og:type" content="video.other" />\n` +
` <meta property="og:site_name" content="surf.nathan.rip" />\n` +
@@ -72,8 +67,7 @@ function buildOgsHtml(video: VideoEntry): string {
tags +=
`\n <meta name="twitter:card" content="summary_large_image" />\n` +
` <meta name="twitter:title" content="${escapeHtml(title)}" />\n` +
` <meta name="twitter:description" content="${escapeHtml(description)}" />`;
` <meta name="twitter:title" content="${escapeHtml(title)}" />`;
if (thumbnailUrl) {
tags += `\n <meta name="twitter:image" content="${thumbnailUrl}" />`;
@@ -86,8 +80,6 @@ export interface OembedResponse {
type: string;
version: string;
title: string;
author_name: string;
author_url: string;
provider_name: string;
provider_url: string;
thumbnail_url?: string;
@@ -106,8 +98,6 @@ export function getOembed(id: string): OembedResponse | null {
type: "video",
version: "1.0",
title: ogTitle(video),
author_name: video.playerName,
author_url: `https://dashboard.momentum-mod.org/maps/${video.mapName}`,
provider_name: "surf.nathan.rip",
provider_url: BASE_URL,
thumbnail_url: thumbnailUrl,