diff --git a/docusaurus.config.ts b/docusaurus.config.ts index 1069810..4e46379 100644 --- a/docusaurus.config.ts +++ b/docusaurus.config.ts @@ -6,6 +6,8 @@ import type { Config } from '@docusaurus/types'; import yaml from 'js-yaml'; import { themes as prismThemes } from 'prism-react-renderer'; +import docuservix from './plugins/docuservix'; + interface DocsConfig { title: string; project: { org: string; repo: string }; @@ -33,6 +35,7 @@ const config: Config = { markdown: { mermaid: true, }, + plugins: [docuservix()], themes: ['@docusaurus/theme-mermaid'], // Future flags, see https://docusaurus.io/docs/api/docusaurus-config#future diff --git a/plugins/docuservix/index.ts b/plugins/docuservix/index.ts new file mode 100644 index 0000000..50dbf9c --- /dev/null +++ b/plugins/docuservix/index.ts @@ -0,0 +1,31 @@ +import path from 'path'; + +import type { LoadContext, Plugin } from '@docusaurus/types'; + +export default function docuservix() { + return function pluginDocuservix(_context: LoadContext): Plugin { + return { + name: 'docuservix', + + configureWebpack() { + return { + resolve: { + alias: { + '@docuservix': path.resolve(__dirname), + }, + }, + }; + }, + + async contentLoaded({ actions }) { + const { addRoute } = actions; + + addRoute({ + path: '/chat', + component: '@docuservix/pages/chat', + exact: true, + }); + }, + }; + }; +} diff --git a/plugins/docuservix/pages/chat/ChatPage.tsx b/plugins/docuservix/pages/chat/ChatPage.tsx new file mode 100644 index 0000000..3bd719b --- /dev/null +++ b/plugins/docuservix/pages/chat/ChatPage.tsx @@ -0,0 +1,10 @@ +import Layout from '@theme/Layout'; +import { ReactNode } from 'react'; + +export function ChatPage(): ReactNode { + return ( + +
Hello world!
+
+ ); +} diff --git a/plugins/docuservix/pages/chat/index.ts b/plugins/docuservix/pages/chat/index.ts new file mode 100644 index 0000000..74f3d81 --- /dev/null +++ b/plugins/docuservix/pages/chat/index.ts @@ -0,0 +1,3 @@ +import { ChatPage } from './ChatPage'; + +export default ChatPage; diff --git a/tsconfig.json b/tsconfig.json index 3035635..aee51ac 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -5,6 +5,11 @@ "extends": "@docusaurus/tsconfig", "compilerOptions": { "baseUrl": ".", + "paths": { + "@docuservix/*": [ + "plugins/docuservix/*" + ] + }, "ignoreDeprecations": "6.0", "strict": true },