Skip to content

Commit d3f8d40

Browse files
committed
Update framing of frontmatter + logic to render in index.md
1 parent 15d5d28 commit d3f8d40

File tree

4 files changed

+18
-4
lines changed

4 files changed

+18
-4
lines changed

src/components/overrides/Head.astro

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,16 @@ if (shouldNoIndex) {
8383
});
8484
}
8585
86+
if (frontmatter.chatbot_deprioritize) {
87+
head.push({
88+
tag: "meta",
89+
attrs: {
90+
name: "pcx_chatbot_deprioritize",
91+
content: frontmatter.chatbot_deprioritize,
92+
},
93+
});
94+
}
95+
8696
if (
8797
frontmatter.description &&
8898
head.findIndex(

src/content/docs/firewall/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ sidebar:
88
head:
99
- tag: title
1010
content: Cloudflare Firewall Rules (deprecated)
11-
chatbot_relevant: false
11+
chatbot_deprioritize: true
1212
---
1313

1414
import { FeatureTable, Render } from "~/components";

src/schemas/base.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,13 @@ export const baseSchema = ({ image }: SchemaContext) =>
9797
.boolean()
9898
.optional()
9999
.describe(
100-
"If true, this property adds a `noindex` declaration to the page, which will tell internal / external search crawlers to ignore this page. Helpful for pages that are historically accurate, but no longer recommended, such as [Workers Sites](/workers/configuration/sites/). Companion to the `chatbot_relevant` property.",
100+
"If true, this property adds a `noindex` declaration to the page, which will tell internal / external search crawlers to ignore this page. Helpful for pages that are historically accurate, but no longer recommended, such as [Workers Sites](/workers/configuration/sites/). Companion to the `chatbot_deprioritize` property.",
101101
),
102-
chatbot_relevant: z
102+
chatbot_deprioritize: z
103103
.boolean()
104104
.optional()
105105
.describe(
106-
"If false, this property will de-prioritize this page in the responses surfaced by Support AI. Helpful for pages that are historically accurate, but no longer recommended, such as [Workers Sites](/workers/configuration/sites/). Companion to the `noindex` property.",
106+
"If true, this property will de-prioritize this page in the responses surfaced by Support AI. Helpful for pages that are historically accurate, but no longer recommended, such as [Workers Sites](/workers/configuration/sites/). Companion to the `noindex` property.",
107107
),
108108
sidebar,
109109
hideChildren: z

src/util/markdown.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,16 @@ export async function htmlToMarkdown(
3232
const description = dom.querySelector("meta[name='description']")?.attributes
3333
.content;
3434
const lastUpdated = dom.querySelector(".meta time")?.attributes.datetime;
35+
const chatbotDeprioritize = dom.querySelector(
36+
"meta[name='pcx_chatbot_deprioritize']",
37+
)?.attributes.content;
3538

3639
const withFrontmatter = [
3740
"---",
3841
`title: ${title}`,
3942
description ? `description: ${description}` : [],
4043
lastUpdated ? `lastUpdated: ${lastUpdated}` : [],
44+
chatbotDeprioritize ? `chatbotDeprioritize: ${chatbotDeprioritize}` : [],
4145
`source_url:`,
4246
` html: ${url.replace("index.md", "")}`,
4347
` md: ${url}`,

0 commit comments

Comments
 (0)