Files
docs/plugins/docuservix-search/index.ts
T
2026-06-18 13:43:32 +03:00

47 lines
1.1 KiB
TypeScript

import path from 'path';
import type { LoadContext, Plugin } from '@docusaurus/types';
interface SearchPluginOptions {
providersModule: string;
}
export default function docuservixSearchPlugin(
_ctx: LoadContext,
options: SearchPluginOptions,
): Plugin {
return {
name: 'docuservix-search',
getThemePath() {
return path.resolve(__dirname, './theme');
},
getTypeScriptThemePath() {
return path.resolve(__dirname, './theme');
},
configureWebpack() {
return {
resolve: {
alias: {
'@docuservix-search/config': options.providersModule,
},
},
};
},
async contentLoaded({ actions }) {
actions.addRoute({
path: '/search',
component: '@theme/SearchPage',
exact: true,
});
actions.addRoute({
path: '/chat-x',
component: '@theme/ChatPage',
exact: true,
});
},
};
}