Skip to content

Commit

Permalink
fix: Fix search loading on file protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
3y3 committed Oct 18, 2024
1 parent 8fb62ba commit 6b8c2b5
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/services/search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,11 @@ function apiLink() {
}

function indexLink(lang: string) {
return outputLink(lang, 'index.json');
return outputLink(lang, 'index.js');
}

function registryLink(lang: string) {
return outputLink(lang, 'registry.json');
return outputLink(lang, 'registry.js');
}

function languageLink(lang: string) {
Expand All @@ -126,15 +126,15 @@ function config(lang: string) {
return {};
}

const short = (link: string, root: string) => link.replace(root, '').replace(/^\/?/, '');
const short = (link: string) => link.replace(output, '').replace(/^\/?/, '');

return {
api: short(apiLink(), bundleDir()),
link: short(pageLink(lang), output),
api: short(apiLink()),
link: short(pageLink(lang)),
resources: {
index: short(indexLink(lang), output),
registry: short(registryLink(lang), output),
language: langs.includes(lang) ? short(languageLink(lang), output) : undefined,
index: short(indexLink(lang)),
registry: short(registryLink(lang)),
language: langs.includes(lang) ? short(languageLink(lang)) : undefined,
},
};
}
Expand Down

0 comments on commit 6b8c2b5

Please sign in to comment.