video strani: iz izpisa odstranjeni hashtagi in stalni promo odstavek (bil je enak na vseh straneh), link do clanka je zdaj prava povezava in ne golo besedilo; VideoObject description uporablja ociscen opis
This commit is contained in:
@@ -18,6 +18,8 @@ export interface YtVideo {
|
||||
durationS: number;
|
||||
teaser: string;
|
||||
description: string;
|
||||
descriptionClean?: string;
|
||||
articleUrl?: string | null;
|
||||
chapters: { t: string; label: string }[];
|
||||
tags: string[];
|
||||
previewUrl: string | null;
|
||||
@@ -141,11 +143,21 @@ export default function VideoDetailPage() {
|
||||
</section>
|
||||
)}
|
||||
|
||||
{v.description && (
|
||||
{v.articleUrl && (
|
||||
<a
|
||||
href={v.articleUrl}
|
||||
className="mt-3 inline-flex items-center gap-2 text-sm font-semibold text-primary hover:underline"
|
||||
data-testid="link-article"
|
||||
>
|
||||
Ganzer Artikel auf folx.tv
|
||||
</a>
|
||||
)}
|
||||
|
||||
{(v.descriptionClean || v.description) && (
|
||||
<section className="mt-8">
|
||||
<h2 className="text-lg font-bold text-foreground mb-2">Zum Video</h2>
|
||||
<p className="whitespace-pre-line text-sm text-muted-foreground leading-relaxed">
|
||||
{v.description.replace(/\n{3,}/g, "\n\n")}
|
||||
{(v.descriptionClean || v.description).replace(/\n{3,}/g, "\n\n")}
|
||||
</p>
|
||||
</section>
|
||||
)}
|
||||
|
||||
+3
-2
@@ -131,7 +131,7 @@ export function serveStatic(app: Express) {
|
||||
const pageUrl = `${canonicalBase}/video/${v.slug}`;
|
||||
const poster = `${canonicalBase}${v.posterUrl}`;
|
||||
const desc = (v.teaser || v.shortTitle || v.title).slice(0, 300);
|
||||
const longDesc = String(v.description || v.teaser || v.shortTitle)
|
||||
const longDesc = String(v.descriptionClean || v.description || v.teaser || v.shortTitle)
|
||||
.replace(/https?:\/\/\S+/g, "").replace(/\s+/g, " ").trim().slice(0, 900);
|
||||
const mins = Math.floor((v.durationS || 0) / 60), secs = (v.durationS || 0) % 60;
|
||||
const embedUrl = v.embedUrl || `https://www.youtube-nocookie.com/embed/${v.ytId}`;
|
||||
@@ -181,7 +181,7 @@ export function serveStatic(app: Express) {
|
||||
// Celoten opis gre v SSR, da ga Google prebere brez JavaScripta.
|
||||
// Prej je bil v HTML samo naslov in teaser (~320 znakov), ostalo je
|
||||
// izrisal sele React.
|
||||
const descHtml = String(v.description || "")
|
||||
const descHtml = String(v.descriptionClean || v.description || "")
|
||||
.split(/\n{2,}/)
|
||||
.map((par: string) => par.trim())
|
||||
.filter((par: string) => par.length > 2 && !/^https?:\/\//.test(par) && !/^[\u2013\u2014-]{4,}$/.test(par))
|
||||
@@ -194,6 +194,7 @@ export function serveStatic(app: Express) {
|
||||
`<p><strong>${escapeHtml(desc)}</strong></p>`,
|
||||
chapterHtml,
|
||||
`<p><a href="${escapeHtml(v.youtubeUrl)}" rel="noopener">Das ganze Video auf YouTube ansehen</a></p>`,
|
||||
v.articleUrl ? `<p><a href="${escapeHtml(v.articleUrl)}">Ganzer Artikel auf folx.tv</a></p>` : "",
|
||||
descHtml ? `<h2>Zum Video</h2>${descHtml}` : "",
|
||||
"</article>",
|
||||
].join("\n");
|
||||
|
||||
Reference in New Issue
Block a user