Add server-side meta tags for player and live pages
Implement server-side rendering for the /player and /live routes to include meta tags for SEO and social media sharing, and update the sitemap.xml. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 401e2ec0-e00d-4f10-9d0e-60f3d479f9a5 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Event-Id: b1b6a2a4-c63a-41e8-b9dd-4cd28944df60 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/60d372ff-2c10-46c7-b01b-10c3435136b0/401e2ec0-e00d-4f10-9d0e-60f3d479f9a5/7NzVbGU
This commit is contained in:
parent
22cd4f35ab
commit
f8ed358592
139
server/routes.ts
139
server/routes.ts
@ -272,6 +272,120 @@ export async function registerRoutes(app: Express): Promise<Server> {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Server-side meta tags for /player page (crawlers + SEO)
|
||||||
|
app.get('/player', (req, res, next) => {
|
||||||
|
const userAgent = req.headers['user-agent']?.toLowerCase() || '';
|
||||||
|
|
||||||
|
const crawlers = [
|
||||||
|
'facebookexternalhit', 'facebot', 'twitterbot', 'whatsapp',
|
||||||
|
'telegrambot', 'linkedinbot', 'pinterest', 'slackbot',
|
||||||
|
'viberbot', 'discordbot', 'applebot', 'googlebot',
|
||||||
|
'bingbot', 'yandex', 'baiduspider', 'duckduckbot'
|
||||||
|
];
|
||||||
|
|
||||||
|
const isCrawler = crawlers.some(crawler => userAgent.includes(crawler));
|
||||||
|
|
||||||
|
if (!isCrawler) {
|
||||||
|
return next();
|
||||||
|
}
|
||||||
|
|
||||||
|
const baseUrl = 'https://video.folx.tv';
|
||||||
|
const pageUrl = `${baseUrl}/player`;
|
||||||
|
const title = 'Professional Player - video.folx.tv';
|
||||||
|
const description = 'Professioneller Video Player mit MTV-Style Overlay Graphics und Streaming-Funktionen auf video.folx.tv';
|
||||||
|
const imageUrl = `${baseUrl}/images/logo.svg`;
|
||||||
|
|
||||||
|
const html = `<!DOCTYPE html>
|
||||||
|
<html lang="de">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>${title}</title>
|
||||||
|
<meta name="description" content="${description}">
|
||||||
|
|
||||||
|
<meta property="og:type" content="website">
|
||||||
|
<meta property="og:title" content="${title}">
|
||||||
|
<meta property="og:description" content="${description}">
|
||||||
|
<meta property="og:image" content="${imageUrl}">
|
||||||
|
<meta property="og:url" content="${pageUrl}">
|
||||||
|
<meta property="og:site_name" content="video.folx.tv">
|
||||||
|
<meta property="og:locale" content="de_DE">
|
||||||
|
|
||||||
|
<meta name="twitter:card" content="summary_large_image">
|
||||||
|
<meta name="twitter:title" content="${title}">
|
||||||
|
<meta name="twitter:description" content="${description}">
|
||||||
|
<meta name="twitter:image" content="${imageUrl}">
|
||||||
|
|
||||||
|
<link rel="canonical" href="${pageUrl}">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>${title}</h1>
|
||||||
|
<p>${description}</p>
|
||||||
|
<p><a href="${pageUrl}">Zum Player auf video.folx.tv</a></p>
|
||||||
|
</body>
|
||||||
|
</html>`;
|
||||||
|
|
||||||
|
res.set('Content-Type', 'text/html');
|
||||||
|
res.send(html);
|
||||||
|
});
|
||||||
|
|
||||||
|
// Server-side meta tags for /live page (crawlers + SEO)
|
||||||
|
app.get('/live', (req, res, next) => {
|
||||||
|
const userAgent = req.headers['user-agent']?.toLowerCase() || '';
|
||||||
|
|
||||||
|
const crawlers = [
|
||||||
|
'facebookexternalhit', 'facebot', 'twitterbot', 'whatsapp',
|
||||||
|
'telegrambot', 'linkedinbot', 'pinterest', 'slackbot',
|
||||||
|
'viberbot', 'discordbot', 'applebot', 'googlebot',
|
||||||
|
'bingbot', 'yandex', 'baiduspider', 'duckduckbot'
|
||||||
|
];
|
||||||
|
|
||||||
|
const isCrawler = crawlers.some(crawler => userAgent.includes(crawler));
|
||||||
|
|
||||||
|
if (!isCrawler) {
|
||||||
|
return next();
|
||||||
|
}
|
||||||
|
|
||||||
|
const baseUrl = 'https://video.folx.tv';
|
||||||
|
const pageUrl = `${baseUrl}/live`;
|
||||||
|
const title = 'LIVE Stream - video.folx.tv';
|
||||||
|
const description = 'Live Stream auf video.folx.tv - Schauen Sie exklusive Inhalte in Echtzeit. FOLX TV Live Streaming rund um die Uhr.';
|
||||||
|
const imageUrl = `${baseUrl}/images/logo.svg`;
|
||||||
|
|
||||||
|
const html = `<!DOCTYPE html>
|
||||||
|
<html lang="de">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>${title}</title>
|
||||||
|
<meta name="description" content="${description}">
|
||||||
|
|
||||||
|
<meta property="og:type" content="website">
|
||||||
|
<meta property="og:title" content="${title}">
|
||||||
|
<meta property="og:description" content="${description}">
|
||||||
|
<meta property="og:image" content="${imageUrl}">
|
||||||
|
<meta property="og:url" content="${pageUrl}">
|
||||||
|
<meta property="og:site_name" content="video.folx.tv">
|
||||||
|
<meta property="og:locale" content="de_DE">
|
||||||
|
|
||||||
|
<meta name="twitter:card" content="summary_large_image">
|
||||||
|
<meta name="twitter:title" content="${title}">
|
||||||
|
<meta name="twitter:description" content="${description}">
|
||||||
|
<meta name="twitter:image" content="${imageUrl}">
|
||||||
|
|
||||||
|
<link rel="canonical" href="${pageUrl}">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>${title}</h1>
|
||||||
|
<p>${description}</p>
|
||||||
|
<p><a href="${pageUrl}">Zum Live Stream auf video.folx.tv</a></p>
|
||||||
|
</body>
|
||||||
|
</html>`;
|
||||||
|
|
||||||
|
res.set('Content-Type', 'text/html');
|
||||||
|
res.send(html);
|
||||||
|
});
|
||||||
|
|
||||||
// Sitemap.xml for SEO
|
// Sitemap.xml for SEO
|
||||||
app.get("/sitemap.xml", async (req, res) => {
|
app.get("/sitemap.xml", async (req, res) => {
|
||||||
try {
|
try {
|
||||||
@ -297,6 +411,31 @@ export async function registerRoutes(app: Express): Promise<Server> {
|
|||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
<priority>1.0</priority>
|
<priority>1.0</priority>
|
||||||
</url>
|
</url>
|
||||||
|
<url>
|
||||||
|
<loc>${baseUrl}/live</loc>
|
||||||
|
<changefreq>always</changefreq>
|
||||||
|
<priority>0.9</priority>
|
||||||
|
</url>
|
||||||
|
<url>
|
||||||
|
<loc>${baseUrl}/player</loc>
|
||||||
|
<changefreq>weekly</changefreq>
|
||||||
|
<priority>0.7</priority>
|
||||||
|
</url>
|
||||||
|
<url>
|
||||||
|
<loc>${baseUrl}/folx-stadl</loc>
|
||||||
|
<changefreq>weekly</changefreq>
|
||||||
|
<priority>0.7</priority>
|
||||||
|
</url>
|
||||||
|
<url>
|
||||||
|
<loc>${baseUrl}/geschichte-lied</loc>
|
||||||
|
<changefreq>weekly</changefreq>
|
||||||
|
<priority>0.7</priority>
|
||||||
|
</url>
|
||||||
|
<url>
|
||||||
|
<loc>${baseUrl}/gipfelstammtisch</loc>
|
||||||
|
<changefreq>weekly</changefreq>
|
||||||
|
<priority>0.7</priority>
|
||||||
|
</url>
|
||||||
`;
|
`;
|
||||||
|
|
||||||
for (const video of videos) {
|
for (const video of videos) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user