From 656fb356b56fa06fc89394ed9957e23f2ba8a762 Mon Sep 17 00:00:00 2001 From: Alexander Belanger Date: Thu, 12 Mar 2026 15:53:40 -0400 Subject: [PATCH] feat: hidden keywords --- frontend/docs/components/Keywords.tsx | 19 +++++++++++++++++++ frontend/docs/lib/search-config.ts | 4 ++-- frontend/docs/pages/v1/index.mdx | 9 +++++---- frontend/docs/pages/v1/quickstart.mdx | 3 ++- .../docs/pages/v1/using-coding-agents.mdx | 3 ++- frontend/docs/scripts/generate-llms.ts | 12 ++++++++++++ 6 files changed, 42 insertions(+), 8 deletions(-) create mode 100644 frontend/docs/components/Keywords.tsx diff --git a/frontend/docs/components/Keywords.tsx b/frontend/docs/components/Keywords.tsx new file mode 100644 index 000000000..da7b12f95 --- /dev/null +++ b/frontend/docs/components/Keywords.tsx @@ -0,0 +1,19 @@ +/** + * Keywords component — visually hidden, but indexed with high weight in + * the MiniSearch search index. Place at the bottom of a docs page to + * boost discoverability for synonyms and alternate phrasings. + * + * Usage: + * + * + * The `generate-llms` script extracts the `keywords` prop and stores it in + * a dedicated high-boost field in the search index. The component itself + * renders a visually-hidden element so the text is never seen by readers. + */ +export default function Keywords({ keywords }: { keywords: string }) { + return ( + + ); +} diff --git a/frontend/docs/lib/search-config.ts b/frontend/docs/lib/search-config.ts index b7b256dab..340e5c135 100644 --- a/frontend/docs/lib/search-config.ts +++ b/frontend/docs/lib/search-config.ts @@ -144,7 +144,7 @@ function processTerm(term: string): string | null { * as single tokens so that code-pattern queries match precisely. */ export const MINISEARCH_OPTIONS = { - fields: ["title", "content", "codeIdentifiers"] as string[], + fields: ["title", "content", "codeIdentifiers", "keywords"] as string[], storeFields: ["title", "pageTitle", "pageRoute"] as string[], processTerm, }; @@ -153,7 +153,7 @@ export const MINISEARCH_OPTIONS = { * Default search options for querying the index. */ export const SEARCH_OPTIONS = { - boost: { title: 2, codeIdentifiers: 3 }, + boost: { title: 2, codeIdentifiers: 3, keywords: 5 }, prefix: true, fuzzy: 0.2, combineWith: "OR" as const, diff --git a/frontend/docs/pages/v1/index.mdx b/frontend/docs/pages/v1/index.mdx index 29f3f00b2..76821f03c 100644 --- a/frontend/docs/pages/v1/index.mdx +++ b/frontend/docs/pages/v1/index.mdx @@ -4,6 +4,7 @@ asIndexPage: true import { Callout } from "nextra/components"; import LanguageSwitcher from "@/components/LanguageSwitcher"; +import Keywords from "@/components/Keywords"; # What is Hatchet? @@ -31,7 +32,7 @@ All tasks and workflows are **defined as code**, making them easy to version, te While Hatchet is a general-purpose orchestration platform, it's particularly well-suited for: -- **AI agents** — Hatchet's durability features allow agents to automatically checkpoint their current state and pickup where they left off when faced with unexpected errors. Hatchet's observability features and distributed-first approach are built for debugging long-running agents at scale. +- **AI agents** — Hatchet's durability features allow agents to automatically checkpoint their current state and pick up where they left off when faced with unexpected errors. Hatchet's observability features and distributed-first approach are built for debugging long-running agents at scale. - **Massive parallelization** - Hatchet is built to handle millions of parallel task executions without overloading your workers. Worker-level slot control allows your workers to only accept the amount of work they can handle, while features like [fairness](/v1/concurrency) and [priorities](/v1/priority) are built to help scale massively parallel ingestion. - **Mission-critical workloads** - everything in Hatchet is durable by default. This means that every task, DAG, event or agent invocation is stored in a durable event log and ready to be replayed at some point in the future. @@ -39,9 +40,9 @@ While Hatchet is a general-purpose orchestration platform, it's particularly wel If you plan on self-hosting or have requirements for an on-premise deployment, there are some additional considerations: -🐘 **Minimal Infra Dependencies** - Hatchet is built on top of PostgreSQL and for simple workloads, [it's all you need](/self-hosting/hatchet-lite). +**Minimal Infra Dependencies** - Hatchet is built on top of PostgreSQL and for simple workloads, [it's all you need](/self-hosting/hatchet-lite). -⬆️ **Fully Featured Open Source** - Hatchet is 100% MIT licensed, so you can run the same application code against [Hatchet Cloud](https://cloud.onhatchet.run) to get started quickly or [self-host](/self-hosting) when you need more control. +**Fully Featured Open Source** - Hatchet is 100% MIT licensed, so you can run the same application code against [Hatchet Cloud](https://cloud.onhatchet.run) to get started quickly or [self-host](/self-hosting) when you need more control. ## Production Readiness @@ -57,4 +58,4 @@ Hatchet has been battle-tested in production environments, processing billions o Get started quickly with the **[Hatchet Cloud Quickstart](/v1/quickstart)** or **[self-hosting](/self-hosting)**. -Keywords: overview, introduction, concepts, use cases, production readiness, self hosting + diff --git a/frontend/docs/pages/v1/quickstart.mdx b/frontend/docs/pages/v1/quickstart.mdx index 54b0bffb6..ac3ed3a47 100644 --- a/frontend/docs/pages/v1/quickstart.mdx +++ b/frontend/docs/pages/v1/quickstart.mdx @@ -6,6 +6,7 @@ import { snippets } from "@/lib/generated/snippets"; import { Snippet } from "@/components/code"; import { Callout, Card, Cards, Steps, Tabs } from "nextra/components"; import UniversalTabs from "../../components/UniversalTabs"; +import Keywords from "@/components/Keywords"; # Hatchet Cloud Quickstart @@ -110,4 +111,4 @@ And that's it! You should now have a Hatchet project set up on Hatchet Cloud wit Once you've completed the quickstart, continue to the next section to learn how to [create your first task](/v1/tasks). -Keywords: quickstart, cloud, getting started, installation, trigger + diff --git a/frontend/docs/pages/v1/using-coding-agents.mdx b/frontend/docs/pages/v1/using-coding-agents.mdx index bdf2cbe62..9d3888236 100644 --- a/frontend/docs/pages/v1/using-coding-agents.mdx +++ b/frontend/docs/pages/v1/using-coding-agents.mdx @@ -8,6 +8,7 @@ import { ClaudeCodeTabLabel, OtherAgentsTabLabel, } from "@/components/McpSetup"; +import Keywords from "@/components/Keywords"; # Using Coding Agents @@ -150,4 +151,4 @@ For any AI tool that supports [llms.txt](https://llmstxt.org/), Hatchet docs are Every documentation page also includes a `` header pointing to its markdown version, and a "View as Markdown" link at the top of the page. -Keywords: mcp, skills, cursor, claude code, llms.txt + diff --git a/frontend/docs/scripts/generate-llms.ts b/frontend/docs/scripts/generate-llms.ts index 461eb175e..c3f6dfc71 100644 --- a/frontend/docs/scripts/generate-llms.ts +++ b/frontend/docs/scripts/generate-llms.ts @@ -652,10 +652,20 @@ interface SearchDoc { title: string; content: string; codeIdentifiers: string; + keywords: string; pageTitle: string; pageRoute: string; } +/** + * Extract the keywords string from a component + * in raw MDX source. Returns an empty string if none is found. + */ +function extractKeywords(rawMdx: string): string { + const match = rawMdx.match(//); + return match ? match[1] : ""; +} + /** * Extract compound code identifiers from fenced code blocks in markdown. * Finds dotted identifiers (e.g. hatchet.task, ctx.spawn, hatchet.workflow) @@ -789,6 +799,7 @@ function buildSearchIndex( const urlPath = page.href.replace(DOCS_BASE_URL + "/", ""); const pageRoute = `hatchet://docs/${urlPath}`; + const keywords = extractKeywords(raw); const sections = splitByH2(md); for (const section of sections) { @@ -812,6 +823,7 @@ function buildSearchIndex( title, content: section.content, codeIdentifiers: extractCodeIdentifiers(section.content), + keywords, pageTitle: page.title, pageRoute, });