|
| 1 | +import type { OramaDocument } from "fumadocs-core/search/orama-cloud"; |
| 2 | +import { source } from "@/lib/source"; |
| 3 | + |
| 4 | +const includedUrls = new Set([ |
| 5 | + "/", |
| 6 | + "/blog/introduction", |
| 7 | + "/communities/introduction", |
| 8 | + "/courses/introduction", |
| 9 | + "/developers/introduction", |
| 10 | + "/downloads/introduction", |
| 11 | + "/email-marketing/introduction", |
| 12 | + "/getting-started/features", |
| 13 | + "/getting-started/quick-start", |
| 14 | + "/schools/add-custom-domain", |
| 15 | + "/schools/introduction", |
| 16 | + "/schools/set-up-payments", |
| 17 | + "/schools/sso", |
| 18 | + "/self-hosting/introduction", |
| 19 | + "/self-hosting/self-host", |
| 20 | + "/users/introduction", |
| 21 | + "/website/introduction", |
| 22 | + "/website/sales-pages", |
| 23 | + "/downloads/lead-magnet", |
| 24 | + "/email-marketing/broadcasts", |
| 25 | +]); |
| 26 | + |
| 27 | +export async function exportSearchIndexes(): Promise<OramaDocument[]> { |
| 28 | + return source |
| 29 | + .getPages() |
| 30 | + .filter((page: any) => includedUrls.has(page.url)) |
| 31 | + .map((page: any) => ({ |
| 32 | + id: page.url, |
| 33 | + structured: page.data.structuredData, |
| 34 | + url: page.url, |
| 35 | + title: page.data.title, |
| 36 | + description: page.data.description, |
| 37 | + })); |
| 38 | +} |
0 commit comments