Skip to content

Commit

Permalink
fix: do not index a page without a content type
Browse files Browse the repository at this point in the history
The type is used to get a url for the page, so it should always be set (as long as pages are clickable results with a target)
  • Loading branch information
mlbrgl committed Mar 7, 2025
1 parent b125d62 commit bae7e3e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion baker/algolia/utils/pages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ function generateGdocRecords(
const records: PageRecord[] = []
for (const gdoc of gdocs) {
if (!gdoc.content.body) continue
if (!gdoc.content.type) continue
// Only rendering the blocks - not the page nav, title, byline, etc
const renderedPostContent = ReactDOMServer.renderToStaticMarkup(
createElement(
Expand All @@ -256,7 +257,7 @@ function generateGdocRecords(
const record = {
objectID: `${gdoc.id}-c${i}`,
importance: getPostImportance(gdoc),
type: gdoc.content.type as PageType,
type: gdoc.content.type,
slug: gdoc.slug,
title: gdoc.content.title || "",
content: chunk,
Expand Down

0 comments on commit bae7e3e

Please sign in to comment.