P0-2 (Adsanity iframe path removed): - AdImage.tsx: deleted the iframe branch and the ADSANITY_CAMPAIGN_MAP fallback. AdImage now renders local images only; banners without a src render nothing. - ads.ts: removed Ad.adsanity_id from the interface. Pruned AJA, Zixi, Lectrosonics, Opengear, Studio Hero, Magewell 300x250 and Blackmagic 300x600 — they relied on ads.broadcastbeat.com which does not resolve. Surviving live banners: LiveU 728x90, LiveU PAYG 300x250, Telycam 300x250. - SidebarAdStack: key no longer references the removed field. - No banner_analytics rows reference ads.broadcastbeat.com. Phase A (SEO baseline): - robots.ts: fallback base URL now broadcastbeat.com (was rocket staging URL). - sitemap.ts: fallback base URL now broadcastbeat.com (was bb-staging). - news/[slug]/page.tsx and articles/[slug]/page.tsx: same fallback fix. JSON-LD now uses ISO 8601 for datePublished, absolute image URL via SITE_URL prefix, and publisher.logo points at /assets/images/logo.png instead of the 404-ing /legacy/site/broadcastbeat-logo.png. - layout.tsx: removed the /en /es /pt /fr /de /zh /ja /ar /hi hreflang alternates - those routes 404 today; Phase D will reinstate. Replaced rocket.new Organization schema URL with broadcastbeat.com. Set robots index/follow=false until Phase B-D land and Rich Results passes. Featured-image fallback hardening: - legacy-source: rowToArticle now treats BB_Gray, no_image and placeholder URLs as null and falls back to the new placeholder so dead images do not leak through to the page. - public/assets/images/article-placeholder.svg: new clean dark gradient with BroadcastBeat wordmark, NOT no_image.png style. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
54 lines
2.9 KiB
TypeScript
54 lines
2.9 KiB
TypeScript
import { MetadataRoute } from 'next';
|
|
import { getLegacyRecentSitemapEntries } from '@/lib/articles/legacy-source';
|
|
|
|
const BASE_URL = process.env.NEXT_PUBLIC_SITE_URL || 'https://broadcastbeat.com';
|
|
|
|
export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
|
|
// Static pages
|
|
const staticPages: MetadataRoute.Sitemap = [
|
|
{ url: `${BASE_URL}/`, lastModified: new Date(), changeFrequency: 'daily', priority: 1.0 },
|
|
{ url: `${BASE_URL}/home-page`, lastModified: new Date(), changeFrequency: 'daily', priority: 1.0 },
|
|
{ url: `${BASE_URL}/news`, lastModified: new Date(), changeFrequency: 'hourly', priority: 0.9 },
|
|
{ url: `${BASE_URL}/gear`, lastModified: new Date(), changeFrequency: 'daily', priority: 0.8 },
|
|
{ url: `${BASE_URL}/technology`, lastModified: new Date(), changeFrequency: 'daily', priority: 0.8 },
|
|
{ url: `${BASE_URL}/show-coverage`, lastModified: new Date(), changeFrequency: 'weekly', priority: 0.8 },
|
|
{ url: `${BASE_URL}/forum`, lastModified: new Date(), changeFrequency: 'daily', priority: 0.8 },
|
|
{ url: `${BASE_URL}/about`, lastModified: new Date(), changeFrequency: 'monthly', priority: 0.6 },
|
|
{ url: `${BASE_URL}/advertise`, lastModified: new Date(), changeFrequency: 'monthly', priority: 0.6 },
|
|
{ url: `${BASE_URL}/contributor`, lastModified: new Date(), changeFrequency: 'monthly', priority: 0.5 },
|
|
{ url: `${BASE_URL}/marketplace`, lastModified: new Date(), changeFrequency: 'daily', priority: 0.7 },
|
|
{ url: `${BASE_URL}/marketplace/jobs`, lastModified: new Date(), changeFrequency: 'daily', priority: 0.7 },
|
|
{ url: `${BASE_URL}/marketplace/gigs`, lastModified: new Date(), changeFrequency: 'daily', priority: 0.7 },
|
|
{ url: `${BASE_URL}/privacy`, lastModified: new Date(), changeFrequency: 'yearly', priority: 0.3 },
|
|
{ url: `${BASE_URL}/terms`, lastModified: new Date(), changeFrequency: 'yearly', priority: 0.3 },
|
|
];
|
|
|
|
// Dynamic article pages — sourced from bb.wp_imported_posts (DB).
|
|
const articleEntries = await getLegacyRecentSitemapEntries(5000);
|
|
const articlePages: MetadataRoute.Sitemap = articleEntries.flatMap(({ slug, date }) => {
|
|
const lastModified = new Date(date);
|
|
const safe = isNaN(lastModified.getTime()) ? new Date() : lastModified;
|
|
return [
|
|
{
|
|
url: `${BASE_URL}/news/${slug}`,
|
|
lastModified: safe,
|
|
changeFrequency: 'monthly' as const,
|
|
priority: 0.7,
|
|
},
|
|
{
|
|
url: `${BASE_URL}/articles/${slug}`,
|
|
lastModified: safe,
|
|
changeFrequency: 'monthly' as const,
|
|
priority: 0.6,
|
|
},
|
|
];
|
|
});
|
|
|
|
// Attempt to ping Google Search Console (fire-and-forget, non-blocking)
|
|
const sitemapUrl = encodeURIComponent(`${BASE_URL}/sitemap.xml`);
|
|
fetch(`https://www.google.com/ping?sitemap=${sitemapUrl}`, { method: 'GET' }).catch(() => {
|
|
// Silently ignore — ping is best-effort
|
|
});
|
|
|
|
return [...staticPages, ...articlePages];
|
|
} |