Aktuelles gre cel iz indeksa: /aktuelles dobi noindex, follow in lasten canonical (prej canonical na naslovnico), kategorijske strani rubrik iz Aktuelles noindex, /aktuelles ven iz sitemapa. Clanki teh rubrik so bili noindex ze od df15293.

This commit is contained in:
folx bot
2026-08-27 07:34:16 +02:00
parent debbf5ff1f
commit 3d1918c2cc
2 changed files with 22 additions and 1 deletions
+1 -1
View File
@@ -147,7 +147,7 @@ export async function registerRoutes(
// POZOR: tu smejo biti samo poti, ki jih pozna React router v App.tsx. // POZOR: tu smejo biti samo poti, ki jih pozna React router v App.tsx.
// Prej so bile "/news", "/video", "/galerie" — teh poti ni, zato je Google // Prej so bile "/news", "/video", "/galerie" — teh poti ni, zato je Google
// dobival soft 404. Prave so "/category/News", "/videos", "/gallery". // dobival soft 404. Prave so "/category/News", "/videos", "/gallery".
const staticPaths = ["/", "/aktuelles", "/category/News", "/videos", "/gallery", const staticPaths = ["/", "/category/News", "/videos", "/gallery",
"/horoskop", "/rezepte", "/empfang-folx-tv", "/ueber-uns", "/horoskop", "/rezepte", "/empfang-folx-tv", "/ueber-uns",
"/kontakt", "/impressum", "/datenschutz"]; "/kontakt", "/impressum", "/datenschutz"];
const urls: string[] = []; const urls: string[] = [];
+21
View File
@@ -357,6 +357,11 @@ export function serveStatic(app: Express) {
`<script type="application/ld+json">${JSON.stringify(itemLd).replace(/</g, "\\u003c")}</script>`, `<script type="application/ld+json">${JSON.stringify(itemLd).replace(/</g, "\\u003c")}</script>`,
].join("\n "); ].join("\n ");
template = template.replace(/<title>[^<]*<\/title>/, tags); template = template.replace(/<title>[^<]*<\/title>/, tags);
// Rubrike, ki sestavljajo /aktuelles, niso del indeksiranega dela strani:
// clanki so ze noindex, zato tudi njihov seznam ne sme v indeks.
if (Array.from(ONE_RUBRIKEN).some((r) => r.toLowerCase() === cat.toLowerCase())) {
template = setRobots(template, "noindex, follow");
}
const ssr = [ const ssr = [
'<section class="ssr-content">', '<section class="ssr-content">',
`<h1>${escapeHtml(cat)}</h1>`, `<h1>${escapeHtml(cat)}</h1>`,
@@ -606,6 +611,22 @@ export function serveStatic(app: Express) {
return; return;
} }
// ---- /aktuelles: zbirna stran rubrik, ki so vse noindex. Prej je vracala
// HTML naslovnice s canonical "/", kar je Google bral kot podvojeno
// naslovnico. Zdaj ima svoj canonical in noindex, follow. ----
if (/^\/aktuelles\/?$/.test(url.split("?")[0].split("#")[0])) {
let template = await fs.promises.readFile(indexPath, "utf-8");
template = stripExistingMeta(template);
const aktTitle = "Aktuelles | Folx Music Television";
template = template.replace(/<title>[^<]*<\/title>/, [
'<meta name="robots" content="noindex, follow" />',
`<link rel="canonical" href="${canonicalBase}/aktuelles" />`,
`<title>${escapeHtml(aktTitle)}</title>`,
].join("\n "));
res.status(200).set({ "Content-Type": "text/html" }).end(template);
return;
}
// Neznana pot mora vrniti PRAVI 404, sicer Google dobi soft 404 (HTTP 200 // Neznana pot mora vrniti PRAVI 404, sicer Google dobi soft 404 (HTTP 200
// z naslovnico). Seznam mora ustrezati potem v client/src/App.tsx. // z naslovnico). Seznam mora ustrezati potem v client/src/App.tsx.
const KNOWN = [ const KNOWN = [