route.ts 572 B

1234567891011121314151617
  1. import { source } from '@/lib/source';
  2. import { createFromSource } from 'fumadocs-core/search/server';
  3. // Required for `output: 'export'` — the search index is fully static.
  4. export const revalidate = false;
  5. export const dynamic = 'force-static';
  6. // Every locale still serves English fallback content, so all map to zbsearch's
  7. // English tokenizer (its SUPPORTED_LANGUAGES has no Persian or Chinese anyway).
  8. export const { staticGET: GET } = createFromSource(source, {
  9. localeMap: {
  10. en: 'english',
  11. fa: 'english',
  12. ru: 'english',
  13. zh: 'english',
  14. },
  15. });