diff --git a/baker/algolia/utils/pages.ts b/baker/algolia/utils/pages.ts index 24d6d2781cb..d6303b2fd06 100644 --- a/baker/algolia/utils/pages.ts +++ b/baker/algolia/utils/pages.ts @@ -223,7 +223,9 @@ function generateGdocRecords( views_7d: pageviews[`/${gdoc.slug}`]?.views_7d ?? 0, excerpt: gdoc.content.excerpt, date: gdoc.publishedAt!.toISOString(), - modifiedDate: gdoc.updatedAt!.toISOString(), + modifiedDate: ( + gdoc.updatedAt ?? gdoc.publishedAt! + ).toISOString(), tags: gdoc.tags?.map((t) => t.name), documentType: "gdoc" as const, authors: gdoc.content.authors,