rezepte in videos: lasten canonical namesto naslovnice, lasten naslov in opis
This commit is contained in:
@@ -566,6 +566,48 @@ export function serveStatic(app: Express) {
|
||||
}
|
||||
}
|
||||
|
||||
// /rezepte in /videos sta prej vracala canonical na naslovnico, zato ju Google
|
||||
// ni mogel indeksirati kot samostojni strani (29. 8. 2026).
|
||||
const SEKCIJE: Record<string, { pot: string; naslov: string; opis: string } | undefined> = {
|
||||
"/rezepte": {
|
||||
pot: "/rezepte",
|
||||
naslov: "Rezepte \u2013 Rezept des Tages | Folx Music Television",
|
||||
opis: "Jeden Tag ein neues Rezept: einfache Gerichte, Klassiker und Ideen f\u00fcr jeden Anlass \u2013 bei FOLX TV.",
|
||||
},
|
||||
"/videos": {
|
||||
pot: "/videos",
|
||||
naslov: "Videos \u2013 Schlager und Volksmusik | Folx Music Television",
|
||||
opis: "Alle Videos von FOLX TV: Interviews, Auftritte und Musik News aus Schlager und Volksmusik.",
|
||||
},
|
||||
};
|
||||
const sekPot = url.split("?")[0].split("#")[0].replace(/\/$/, "");
|
||||
const sek = SEKCIJE[sekPot];
|
||||
if (sek) {
|
||||
let template = await fs.promises.readFile(indexPath, "utf-8");
|
||||
template = stripExistingMeta(template);
|
||||
const sUrl = `${canonicalBase}${sek.pot}`;
|
||||
const sImg = `${canonicalBase}/images/og-image.jpg`;
|
||||
const sTags = [
|
||||
`<meta property="og:title" content="${escapeHtml(sek.naslov)}" />`,
|
||||
`<meta property="og:description" content="${escapeHtml(sek.opis)}" />`,
|
||||
`<meta property="og:type" content="website" />`,
|
||||
`<meta property="og:url" content="${escapeHtml(sUrl)}" />`,
|
||||
`<meta property="og:image" content="${escapeHtml(sImg)}" />`,
|
||||
`<meta property="og:site_name" content="Folx Music Television" />`,
|
||||
`<meta property="og:locale" content="de_DE" />`,
|
||||
`<meta name="twitter:card" content="summary_large_image" />`,
|
||||
`<meta name="twitter:title" content="${escapeHtml(sek.naslov)}" />`,
|
||||
`<meta name="twitter:description" content="${escapeHtml(sek.opis)}" />`,
|
||||
`<meta name="twitter:image" content="${escapeHtml(sImg)}" />`,
|
||||
`<meta name="description" content="${escapeHtml(sek.opis)}" />`,
|
||||
`<link rel="canonical" href="${escapeHtml(sUrl)}" />`,
|
||||
`<title>${escapeHtml(sek.naslov)}</title>`,
|
||||
].join("\n ");
|
||||
template = template.replace(/<title>[^<]*<\/title>/, sTags);
|
||||
res.status(200).set({ "Content-Type": "text/html" }).end(template);
|
||||
return;
|
||||
}
|
||||
|
||||
if (url.match(/^\/gallery(\/|$|\?)/)) {
|
||||
let template = await fs.promises.readFile(indexPath, "utf-8");
|
||||
template = stripExistingMeta(template);
|
||||
|
||||
Reference in New Issue
Block a user