We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1c1ee07 commit 41afb4dCopy full SHA for 41afb4d
src/app/api/index-to-algolia/route.ts
@@ -8,6 +8,8 @@ import crypto from 'crypto';
8
import { getAllPosts } from '@/lib/api-docs';
9
import Route from '@/lib/route';
10
11
+const DOCS_DIR_PATH = `${process.cwd()}/content/docs`;
12
+
13
const algoliaClient = algoliasearch(
14
process.env.NEXT_PUBLIC_ALGOLIA_APP_ID!,
15
process.env.NEXT_PUBLIC_ALGOLIA_ADMIN_API_KEY!,
@@ -80,7 +82,7 @@ const generateIndexElement = (
80
82
};
81
83
84
const getRecords = () => {
- const docs = getAllPosts().filter((item) => !item.slug.startsWith('tutorials/'));
85
+ const docs = getAllPosts(DOCS_DIR_PATH).filter((item) => !item.slug.startsWith('tutorials/'));
86
87
const resultObj: AlgoliaIndexObject[] = [];
88
0 commit comments