这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions docs/site/scripts/sync-algolia.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ if (!process.env.NEXT_PUBLIC_ALGOLIA_INDEX) {
env.loadEnvConfig(process.cwd());
}

// If you are targeting the development environment, you can get this key from the `turbo-site` project on Vercel.
// If you are targeting the development environment,
// you can get this key from the `turbo-site` project on Vercel
// if you are a part of the Vercel team.
if (!process.env.ALGOLIA_API_KEY) {
throw new Error("No ALGOLIA_API_KEY provided.");
}
Expand All @@ -18,7 +20,10 @@ const ALGOLIA_INDEX_NAME = process.env.NEXT_PUBLIC_ALGOLIA_INDEX ?? "_docs_dev";
const content = fs.readFileSync(".next/server/app/static.json.body");

/** @type {import('fumadocs-core/search/algolia').DocumentRecord[]} **/
const indexes = JSON.parse(content.toString());
const indexes = JSON.parse(content.toString()).filter(
// These path don't have information that we think people want in search.
(doc) => !["docs/community", "/docs"].includes(doc.url)
);

const algoliaClient = algosearch(
process.env.ALGOLIA_APP_ID,
Expand Down
Loading