1
0

route.ts 946 B

12345678910111213141516171819202122
  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. // Static search index: works under both SSR/Vercel and static export
  7. // (`output: 'export'`). The client loads this prebuilt index and searches
  8. // in-browser (see the `type: 'static'` search option in app/[lang]/layout.tsx).
  9. // All locales currently hold English (fallback) content, and Orama has no
  10. // Persian tokenizer, so map every locale to the English tokenizer. When real
  11. // translations land, switch ru -> 'russian', zh -> 'mandarin' (with
  12. // @orama/tokenizers), etc. See https://docs.orama.com/open-source/supported-languages
  13. export const { staticGET: GET } = createFromSource(source, {
  14. localeMap: {
  15. en: 'english',
  16. fa: 'english',
  17. ru: 'english',
  18. zh: 'english',
  19. },
  20. });