delete sampleArticles seed; serve all sections from bb.wp_imported_posts (DB)
Eliminates 72 hardcoded rocket.new image refs in one shot. Section pages (/gear, /technology, /show-coverage, /news) now render from bb.wp_imported_posts via getLegacyArticlesBySection(section), which maps each non-news section to a curated tag set (e.g. gear -> Audio, Cameras, lighting, Blackmagic Design, monitoring; technology -> AI, Streaming, OTT, IP, Cloud, AV; show-coverage -> NAB, IBC, BroadcastAsia). Also: - src/lib/articles/types.ts: Article interface lifted out of the deleted seed file. Type-only consumers (NewsArticleDetailClient, ArticleDetailClient, legacy-source) re-imported from here. - /news (client component) now wrapped: server fetches articles from DB and passes to NewsPageClient. Filter UI unchanged. - generateStaticParams on /news/[slug] and /articles/[slug] no longer references seed slugs; pre-renders 50 most-recent imported slugs and relies on dynamicParams + revalidate=3600 for the rest. - sitemap.ts now sources article URLs from getLegacyRecentSitemapEntries() (up to 5000 most-recent imported posts). Default BASE_URL fallback updated from the rocket.new placeholder to bb-staging.onsethost.com. - src/app/api/ai/article-suggestions/route.ts now pulls candidates from the DB (top 100 recent news) and resolves AI-returned slugs via DB lookup if not in the candidate window. Inline rocket.new image refs in homepage components (ArticleFeed, FeaturedBento) are unchanged in this commit; those are inline seed arrays in the components, not imports of sampleArticles.
This commit is contained in:
@@ -5,7 +5,7 @@ import AppImage from "@/components/ui/AppImage";
|
||||
import Header from "@/components/Header";
|
||||
import Footer from "@/components/Footer";
|
||||
import { createClient } from "@/lib/supabase/client";
|
||||
import type { Article } from "@/lib/articles/sampleArticles";
|
||||
import type { Article } from "@/lib/articles/types";
|
||||
|
||||
// DO NOT OVERRIDE — ArticleDetailClient interface and session tracking
|
||||
interface ArticleDetailClientProps {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { Metadata } from "next";
|
||||
import { notFound } from "next/navigation";
|
||||
import ArticleDetailPage from "./ArticleDetailClient";
|
||||
import { sampleArticles, getRelatedArticles, type Article } from "@/lib/articles/sampleArticles";
|
||||
import type { Article } from "@/lib/articles/types";
|
||||
import {
|
||||
getLegacyArticleBySlug,
|
||||
getLegacyRecentSlugs,
|
||||
@@ -22,10 +22,6 @@ async function loadArticle(slug: string): Promise<{
|
||||
article: Article | null;
|
||||
related: Article[];
|
||||
}> {
|
||||
const seed = sampleArticles.find((a) => a.slug === slug);
|
||||
if (seed) {
|
||||
return { article: seed, related: getRelatedArticles(slug, 3) };
|
||||
}
|
||||
const imported = await getLegacyArticleBySlug(slug);
|
||||
if (!imported) return { article: null, related: [] };
|
||||
const related = await getLegacyRelatedArticles(slug, imported.category, 3);
|
||||
@@ -63,9 +59,8 @@ export async function generateMetadata({ params }: PageProps): Promise<Metadata>
|
||||
}
|
||||
|
||||
export async function generateStaticParams() {
|
||||
const seedSlugs = sampleArticles.map((a) => a.slug);
|
||||
const recent = await getLegacyRecentSlugs(50);
|
||||
return Array.from(new Set([...seedSlugs, ...recent])).map((slug) => ({ slug }));
|
||||
return recent.map((slug) => ({ slug }));
|
||||
}
|
||||
|
||||
export default async function ArticlePage({ params }: PageProps) {
|
||||
|
||||
Reference in New Issue
Block a user