🐸 Rybbit - open-source and privacy-friendly alternative to Google Analytics that is 10x more intuitive.
Update documentation and API for improved search functionality
Bill Yang1523d5cfb68c
diff --git a/docs/content/docs/script.mdx b/docs/content/docs/script.mdxindex fb23cfd0c..ecdbb1a04 100644--- a/docs/content/docs/script.mdx+++ b/docs/content/docs/script.mdx@@ -44,7 +44,7 @@ These are the attributes you can pass to the script tag.| `data-debounce` | `string` | `"500"`| The delay (in milliseconds) before tracking a pageview after URL changes via the History API (`pushState`, `replaceState`). Set to `0` to disable debouncing. || `data-tag` | `string` | `""` | A label applied to all events from this script instance. Useful for A/B testing, deploy versioning, or cohort segmentation. Max 256 characters. See [Tagging](/docs/tagging). |-### Feature Flags+{/* ### Feature FlagsThe tracking script automatically evaluates client and both-runtime feature flags when it loads. Read evaluated flags from `window.rybbit` after the script is ready:@@ -64,7 +64,7 @@ Available methods:| `flags()` | Returns all evaluated flag values. || `flagPayloads()` | Returns all available flag payloads. |-See [Feature Flags](/docs/feature-flags) for targeting rules, remote config, and server-side evaluation.+See [Feature Flags](/docs/feature-flags) for targeting rules, remote config, and server-side evaluation. */}### Session Replay Attributesdiff --git a/docs/src/app/[locale]/layout.tsx b/docs/src/app/[locale]/layout.tsxindex 160704792..66d3fb1be 100644--- a/docs/src/app/[locale]/layout.tsx+++ b/docs/src/app/[locale]/layout.tsx@@ -45,6 +45,7 @@ export default async function LocaleLayout({enableSystem: true,}}i18n={provider(locale)}+ search={{ options: { type: 'static' } }}>{children}</RootProvider>diff --git a/docs/src/app/api/search/route.ts b/docs/src/app/api/search/route.tsindex 67507afad..ec24acdce 100644--- a/docs/src/app/api/search/route.ts+++ b/docs/src/app/api/search/route.ts@@ -1,7 +1,12 @@import { source } from '@/lib/source';import { createFromSource } from 'fumadocs-core/search/server';-export const { GET } = createFromSource(source, {+// Build the search index at build time and serve it as a static, CDN-cacheable+// file. The client (RootProvider `search.options.type = 'static'`) downloads it+// once and runs Orama in the browser, so there are no per-keystroke round-trips.+export const revalidate = false;++export const { staticGET: GET } = createFromSource(source, {// https://docs.orama.com/open-source/supported-languageslanguage: 'english',});