diff --git a/baker/algolia/utils/pages.ts b/baker/algolia/utils/pages.ts index d6303b2fd0..e5b5983d9c 100644 --- a/baker/algolia/utils/pages.ts +++ b/baker/algolia/utils/pages.ts @@ -162,7 +162,7 @@ function getGdocThumbnailUrl(gdoc: OwidGdocPostInterface): string { if (gdoc.content["featured-image"]) { return getThumbnailPath(gdoc.content["featured-image"]) } - return `/${DEFAULT_GDOC_FEATURED_IMAGE}` + return `/images/published/${DEFAULT_GDOC_FEATURED_IMAGE}` } function generateGdocRecords( diff --git a/site/search/SearchPanel.tsx b/site/search/SearchPanel.tsx index 26833ed4bf..b6f8b9eddf 100644 --- a/site/search/SearchPanel.tsx +++ b/site/search/SearchPanel.tsx @@ -11,6 +11,7 @@ import { groupBy, uniqBy, Region, + DEFAULT_GDOC_FEATURED_IMAGE, } from "@ourworldindata/utils" import { InstantSearch, @@ -65,6 +66,12 @@ import { ChartHit } from "./ChartHit.js" const siteAnalytics = new SiteAnalytics() function PagesHit({ hit }: { hit: IPageHit }) { + // a temporary fix for articles that have been indexed without the directory + const src = + hit.thumbnailUrl === `/${DEFAULT_GDOC_FEATURED_IMAGE}` + ? `/images/published/${DEFAULT_GDOC_FEATURED_IMAGE}` + : hit.thumbnailUrl + return (