news/featured: own header + tighter pool, hide AI suggestions sidebar
NewsPageClient now accepts kicker / heading / subtitle / hideAiSuggestions props so the curated Featured Editorial view can speak with its own voice instead of borrowing 'Industry News' copy. Featured fetch tightened from 'category ILIKE featured' (63 rows incl. PR-tagged content) to 'featured=true' (editorial pins only), so the page no longer trails into generic news cards under the lead group. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -31,7 +31,26 @@ function parseArticleDate(dateStr: string): Date {
|
||||
return new Date(dateStr);
|
||||
}
|
||||
|
||||
export default function NewsPage({ articles }: { articles: Article[] }) {
|
||||
interface NewsPageProps {
|
||||
articles: Article[];
|
||||
/** Eyebrow label rendered above the H1. Defaults to "News". */
|
||||
kicker?: string;
|
||||
/** Page H1. Defaults to "Industry News". */
|
||||
heading?: string;
|
||||
/** Subhead under the H1. */
|
||||
subtitle?: string;
|
||||
/** Hide the AI Suggested Articles sidebar widget (it surfaces general
|
||||
recommendations and shouldn't appear on curated views like Featured). */
|
||||
hideAiSuggestions?: boolean;
|
||||
}
|
||||
|
||||
export default function NewsPage({
|
||||
articles,
|
||||
kicker = "News",
|
||||
heading = "Industry News",
|
||||
subtitle = "Breaking news and industry updates from the world of broadcast engineering",
|
||||
hideAiSuggestions = false,
|
||||
}: NewsPageProps) {
|
||||
const allArticles = Array.isArray(articles) ? articles : [];
|
||||
const searchParams = useSearchParams();
|
||||
|
||||
@@ -133,11 +152,11 @@ export default function NewsPage({ articles }: { articles: Article[] }) {
|
||||
<div className="bg-[#111] border-b border-[#222] py-8">
|
||||
<div className="max-w-container mx-auto px-4">
|
||||
<div className="flex items-center gap-3 mb-2">
|
||||
<span className="section-label">News</span>
|
||||
<span className="section-label">{kicker}</span>
|
||||
<div className="flex-1 h-px bg-[#2a2a2a]" />
|
||||
</div>
|
||||
<h1 className="font-heading text-white text-3xl font-bold">Industry News</h1>
|
||||
<p className="text-[#777] font-body text-sm mt-2">Breaking news and industry updates from the world of broadcast engineering</p>
|
||||
<h1 className="font-heading text-white text-3xl font-bold">{heading}</h1>
|
||||
<p className="text-[#777] font-body text-sm mt-2">{subtitle}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -304,7 +323,7 @@ export default function NewsPage({ articles }: { articles: Article[] }) {
|
||||
<SidebarAdStack />
|
||||
|
||||
{/* AI Suggested Articles */}
|
||||
<AISuggestedArticles variant="full" />
|
||||
{!hideAiSuggestions && <AISuggestedArticles variant="full" />}
|
||||
|
||||
<div className="bg-[#111] border border-[#222] p-4">
|
||||
<h3 className="font-body font-bold text-xs text-[#3b82f6] uppercase tracking-widest mb-3 pb-2 border-b border-[#222]">
|
||||
|
||||
@@ -16,7 +16,13 @@ export default async function FeaturedNewsPage() {
|
||||
const articles = await getLegacyFeaturedArticles(200);
|
||||
return (
|
||||
<Suspense fallback={null}>
|
||||
<NewsPageClient articles={articles} />
|
||||
<NewsPageClient
|
||||
articles={articles}
|
||||
kicker="Editorial"
|
||||
heading="Featured Editorial"
|
||||
subtitle="Hand-picked feature stories, exclusives, and cover articles from the Broadcast Beat editorial desk."
|
||||
hideAiSuggestions
|
||||
/>
|
||||
</Suspense>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -340,12 +340,15 @@ export async function getLegacyArticlesBySection(
|
||||
|
||||
export async function getLegacyFeaturedArticles(limit = 200): Promise<Article[]> {
|
||||
try {
|
||||
// Strict mode: only rows the editorial team has explicitly pinned via
|
||||
// wp_imported_posts.featured=true. The broader category='featured' pool
|
||||
// also contains older PR-leaning items that should not surface on the
|
||||
// public Featured Editorial page.
|
||||
const { data, error } = await client()
|
||||
.from("wp_imported_posts")
|
||||
.select(SELECT_COLS + ",featured")
|
||||
.eq("status", "published")
|
||||
.ilike("category", "featured")
|
||||
.order("featured", { ascending: false })
|
||||
.eq("featured", true)
|
||||
.order("wp_published_at", { ascending: false, nullsFirst: false })
|
||||
.limit(limit);
|
||||
if (error || !data) return [];
|
||||
|
||||
Reference in New Issue
Block a user