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:
+1
-1
@@ -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[] = [];
|
||||||
|
|||||||
@@ -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 = [
|
||||||
|
|||||||
Reference in New Issue
Block a user