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:
+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