From df340c9ea511d6cda7572009b51051c030b5649a Mon Sep 17 00:00:00 2001 From: Ike Saunders Date: Wed, 10 Jul 2024 11:09:51 -0400 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20remove=20tag=20structure=20dependen?= =?UTF-8?q?cy=20from=20isPostCitable?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/model/Post.ts | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/db/model/Post.ts b/db/model/Post.ts index d8a7788a2a..c9f7399911 100644 --- a/db/model/Post.ts +++ b/db/model/Post.ts @@ -6,7 +6,6 @@ import { parsePostWpApiSnapshot, FullPost, JsonError, - CategoryWithEntries, WP_PostType, FilterFnPostRestApi, PostRestApi, @@ -40,7 +39,6 @@ import { CLOUDFLARE_IMAGES_URL, } from "../../settings/clientSettings.js" import { BLOG_SLUG } from "../../settings/serverSettings.js" -import { SiteNavigationStatic } from "../../site/SiteConstants.js" import { decodeHTML } from "entities" import { getAndLoadListedGdocPosts } from "./Gdoc/GdocFactory.js" @@ -185,22 +183,10 @@ export const getFullPostByIdFromSnapshot = async ( return getFullPost(trx, postEnriched.wpApiSnapshot) } -// TODO: I suggest that in the place where we define SiteNavigationStatic we create a Set with all the leaves and -// then this one becomes a simple lookup in the set. Probably nicest to do the set creation as a memoized function. +// kicking this can till WP posts kick the bucket +// COVID pages are the only WP pages left that are citable, grep "pageOverrides" to see more export const isPostSlugCitable = (slug: string): boolean => { - const entries = SiteNavigationStatic.categories - return entries.some((category) => { - return ( - category.entries.some((entry) => entry.slug === slug) || - (category.subcategories ?? []).some( - (subcategory: CategoryWithEntries) => { - return subcategory.entries.some( - (subCategoryEntry) => subCategoryEntry.slug === slug - ) - } - ) - ) - }) + return slug === "coronavirus" } export const getPostsFromSnapshots = async (