Skip to content

Commit b2a5794

Browse files
committed
fix: algolia links
1 parent d71673f commit b2a5794

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

scripts/post-build.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import env from "@next/env";
2-
import { updateSearchIndexes } from "./update-index.mjs";
32
import type { Manifest } from "fumadocs-mdx";
43
import { readFileSync } from "node:fs";
4+
import { updateSearchIndexes } from "./update-index.mjs";
55

66
env.loadEnvConfig(process.cwd());
77

scripts/update-index.mts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ import path from "node:path";
66

77
const getUrl = createGetUrl("/");
88

9-
const appId = process.env.NEXT_PUBLIC_ALGOLIA_APP_ID;
10-
const apiKey = process.env.ALGOLIA_API_KEY;
11-
129
export async function updateSearchIndexes(manifest: Manifest): Promise<void> {
10+
const appId = process.env.NEXT_PUBLIC_ALGOLIA_APP_ID;
11+
const apiKey = process.env.ALGOLIA_API_KEY;
12+
1313
if (!appId || !apiKey) {
1414
throw new Error("NEXT_PUBLIC_ALGOLIA_APP_ID, ALGOLIA_API_KEY are required");
1515
}
@@ -22,7 +22,7 @@ export async function updateSearchIndexes(manifest: Manifest): Promise<void> {
2222
.filter((file) => file.collection === "docs")
2323
.map((docs) => {
2424
const url = getUrl(
25-
getSlugs(parseFilePath(path.relative("content/", docs.path))),
25+
getSlugs(parseFilePath(path.relative("content/docs/", docs.path))),
2626
);
2727

2828
if (!docs.data.structuredData)

0 commit comments

Comments
 (0)