seo: izdajatelj z registrirano druzbo in strukturirani podatki na naslovnici
Publisher je bil povsod samo ime in logo, naslovnica pa sploh brez JSON-LD. Zdaj gre v NewsArticle, VideoObject in oba clanska grafa ista Organization z legalName PRIME TIME Consulting GmbH, naslovom, kontaktom in sameAs profili, naslovnica pa dobi graf Organization + WebSite s SearchAction.
This commit is contained in:
+67
-18
@@ -70,6 +70,37 @@ const ARTICLE_SLUG_REDIRECTS: Record<string, string> = {
|
|||||||
// Rubrike, ki jih pisemo enkrat in objavimo tudi na onemusic.news. Besedilo je
|
// Rubrike, ki jih pisemo enkrat in objavimo tudi na onemusic.news. Besedilo je
|
||||||
// isto na obeh domenah, zato jih na folx.tv drzimo zunaj Googlovega indeksa —
|
// isto na obeh domenah, zato jih na folx.tv drzimo zunaj Googlovega indeksa —
|
||||||
// v bazi in v /api/articles ostanejo, ker jih bere sidebar na TV kanalih.
|
// v bazi in v /api/articles ostanejo, ker jih bere sidebar na TV kanalih.
|
||||||
|
// Izdajatelj: doslej samo ime in logo. Brez registrirane druzbe, naslova in
|
||||||
|
// profilov Google znamke nima s cim povezati.
|
||||||
|
const PUBLISHER = (base: string) => ({
|
||||||
|
"@type": ["NewsMediaOrganization", "Organization"],
|
||||||
|
"@id": `${base}/#organization`,
|
||||||
|
"name": "FOLX Music Television",
|
||||||
|
"url": base,
|
||||||
|
"legalName": "PRIME TIME Consulting GmbH",
|
||||||
|
"logo": { "@type": "ImageObject", "url": `${base}/og-image.jpg` },
|
||||||
|
"address": {
|
||||||
|
"@type": "PostalAddress",
|
||||||
|
"streetAddress": "Sigmaringer Str. 10",
|
||||||
|
"postalCode": "72379",
|
||||||
|
"addressLocality": "Hechingen",
|
||||||
|
"addressCountry": "DE",
|
||||||
|
},
|
||||||
|
"contactPoint": {
|
||||||
|
"@type": "ContactPoint",
|
||||||
|
"contactType": "customer service",
|
||||||
|
"email": "office@primetime.consulting",
|
||||||
|
"telephone": "+49 172 5675800",
|
||||||
|
"areaServed": ["DE", "AT", "CH"],
|
||||||
|
"availableLanguage": ["German"],
|
||||||
|
},
|
||||||
|
"sameAs": [
|
||||||
|
"https://www.facebook.com/folxtv",
|
||||||
|
"https://www.instagram.com/folxtv/",
|
||||||
|
"https://www.youtube.com/@FOLXTV",
|
||||||
|
],
|
||||||
|
});
|
||||||
|
|
||||||
const ONE_RUBRIKEN = new Set(["Politik", "Promis", "Sport", "Musik & Film", "Wetter", "Finanzen", "Aktuelles"]);
|
const ONE_RUBRIKEN = new Set(["Politik", "Promis", "Sport", "Musik & Film", "Wetter", "Finanzen", "Aktuelles"]);
|
||||||
|
|
||||||
function setRobots(html: string, content: string): string {
|
function setRobots(html: string, content: string): string {
|
||||||
@@ -165,11 +196,7 @@ export function serveStatic(app: Express) {
|
|||||||
"contentUrl": v.youtubeUrl,
|
"contentUrl": v.youtubeUrl,
|
||||||
"isFamilyFriendly": true,
|
"isFamilyFriendly": true,
|
||||||
"inLanguage": "de",
|
"inLanguage": "de",
|
||||||
"publisher": {
|
"publisher": PUBLISHER(canonicalBase),
|
||||||
"@type": "Organization",
|
|
||||||
"name": "Folx Music Television",
|
|
||||||
"logo": { "@type": "ImageObject", "url": `${canonicalBase}/og-image.jpg` },
|
|
||||||
},
|
|
||||||
"mainEntityOfPage": { "@type": "WebPage", "@id": pageUrl },
|
"mainEntityOfPage": { "@type": "WebPage", "@id": pageUrl },
|
||||||
...(chaps.length >= 3 ? {
|
...(chaps.length >= 3 ? {
|
||||||
hasPart: chaps.map((c: any, i: number) => ({
|
hasPart: chaps.map((c: any, i: number) => ({
|
||||||
@@ -237,6 +264,39 @@ export function serveStatic(app: Express) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ---- Naslovnica: doslej brez strukturiranih podatkov. Organization in
|
||||||
|
// WebSite sta tista dva vozlisca, na katera se veze vse ostalo. ----
|
||||||
|
if (url === "/" || url.startsWith("/?")) {
|
||||||
|
try {
|
||||||
|
let template = await fs.promises.readFile(indexPath, "utf-8");
|
||||||
|
const homeLd = {
|
||||||
|
"@context": "https://schema.org",
|
||||||
|
"@graph": [
|
||||||
|
PUBLISHER(canonicalBase),
|
||||||
|
{
|
||||||
|
"@type": "WebSite",
|
||||||
|
"@id": `${canonicalBase}/#website`,
|
||||||
|
"url": `${canonicalBase}/`,
|
||||||
|
"name": "FOLX Music Television",
|
||||||
|
"inLanguage": "de-DE",
|
||||||
|
"publisher": { "@id": `${canonicalBase}/#organization` },
|
||||||
|
"potentialAction": {
|
||||||
|
"@type": "SearchAction",
|
||||||
|
"target": { "@type": "EntryPoint", "urlTemplate": `${canonicalBase}/suche?q={search_term_string}` },
|
||||||
|
"query-input": "required name=search_term_string",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
template = template.replace(
|
||||||
|
"</head>",
|
||||||
|
`<script type="application/ld+json">${JSON.stringify(homeLd).replace(/</g, "\\u003c")}</script>\n</head>`);
|
||||||
|
res.status(200).set({ "Content-Type": "text/html" }).end(template);
|
||||||
|
return;
|
||||||
|
} catch (e) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// ---- /category/<ime>: prej je vrnil HTML naslovnice s canonical "/" in
|
// ---- /category/<ime>: prej je vrnil HTML naslovnice s canonical "/" in
|
||||||
// brez vsebine, kar je Google bral kot soft 404 / podvojeno naslovnico ----
|
// brez vsebine, kar je Google bral kot soft 404 / podvojeno naslovnico ----
|
||||||
const catMatch = url.match(/^\/category\/([^?#\/]+)/);
|
const catMatch = url.match(/^\/category\/([^?#\/]+)/);
|
||||||
@@ -366,14 +426,7 @@ export function serveStatic(app: Express) {
|
|||||||
"name": article.author || "Folx Music Television",
|
"name": article.author || "Folx Music Television",
|
||||||
"url": canonicalBase,
|
"url": canonicalBase,
|
||||||
},
|
},
|
||||||
"publisher": {
|
"publisher": PUBLISHER(canonicalBase),
|
||||||
"@type": "Organization",
|
|
||||||
"name": "Folx Music Television",
|
|
||||||
"logo": {
|
|
||||||
"@type": "ImageObject",
|
|
||||||
"url": `${canonicalBase}/og-image.jpg`,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
"mainEntityOfPage": {
|
"mainEntityOfPage": {
|
||||||
"@type": "WebPage",
|
"@type": "WebPage",
|
||||||
"@id": articleUrl,
|
"@id": articleUrl,
|
||||||
@@ -390,11 +443,7 @@ export function serveStatic(app: Express) {
|
|||||||
"uploadDate": pubDate,
|
"uploadDate": pubDate,
|
||||||
"embedUrl": `https://www.youtube.com/embed/${videoId}`,
|
"embedUrl": `https://www.youtube.com/embed/${videoId}`,
|
||||||
"contentUrl": `https://www.youtube.com/watch?v=${videoId}`,
|
"contentUrl": `https://www.youtube.com/watch?v=${videoId}`,
|
||||||
"publisher": {
|
"publisher": PUBLISHER(canonicalBase),
|
||||||
"@type": "Organization",
|
|
||||||
"name": "Folx Music Television",
|
|
||||||
"logo": { "@type": "ImageObject", "url": `${canonicalBase}/og-image.jpg` },
|
|
||||||
},
|
|
||||||
} : null;
|
} : null;
|
||||||
const videoLdTag = videoLd
|
const videoLdTag = videoLd
|
||||||
? `<script type="application/ld+json">${JSON.stringify(videoLd).replace(/</g, "\\u003c")}</script>`
|
? `<script type="application/ld+json">${JSON.stringify(videoLd).replace(/</g, "\\u003c")}</script>`
|
||||||
|
|||||||
Reference in New Issue
Block a user