news/featured: broaden filter back to category=featured w/ pinned-first sort
featured=true alone only matches 1 row right now, which would leave the Featured Editorial page nearly empty. Broader category match keeps the page full while featured DESC still bubbles editorial pins to the top. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -340,15 +340,16 @@ 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.
|
||||
// Show every row in the Featured category, but bubble editorial pins
|
||||
// (featured=true) to the top. Strict "featured=true only" filtering was
|
||||
// tried briefly and left the page near-empty (1 row); the broader pool
|
||||
// gives the page real depth while pins still lead.
|
||||
const { data, error } = await client()
|
||||
.from("wp_imported_posts")
|
||||
.select(SELECT_COLS + ",featured")
|
||||
.eq("status", "published")
|
||||
.eq("featured", true)
|
||||
.ilike("category", "featured")
|
||||
.order("featured", { ascending: false })
|
||||
.order("wp_published_at", { ascending: false, nullsFirst: false })
|
||||
.limit(limit);
|
||||
if (error || !data) return [];
|
||||
|
||||
Reference in New Issue
Block a user