From 3adc965dd09490b7efa1cce9f09b0a3b30970277 Mon Sep 17 00:00:00 2001 From: 简律纯 Date: Wed, 19 Apr 2023 17:30:39 +0800 Subject: ✨优化文档 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/app/module.ts | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 docs/app/module.ts (limited to 'docs/app/module.ts') diff --git a/docs/app/module.ts b/docs/app/module.ts new file mode 100644 index 0000000..4e425a6 --- /dev/null +++ b/docs/app/module.ts @@ -0,0 +1,25 @@ +import { fileURLToPath } from 'url' +import { addPlugin, defineNuxtModule } from '@nuxt/kit' +import { resolve } from 'pathe' + +const themeDir = fileURLToPath(new URL('./', import.meta.url)) +const resolveThemeDir = (path: string) => resolve(themeDir, path) + +export default defineNuxtModule({ + meta: { + name: 'docus', + version: '3.0.0', + compatibility: { + nuxt: '^3.0.0-rc.14', + bridge: false + }, + configKey: 'docus' + }, + setup (_, nuxt) { + if (nuxt.options?.runtimeConfig?.public?.algolia?.docSearch) { + addPlugin({ + src: resolveThemeDir('integrations/docsearch.ts') + }) + } + } +}) -- cgit v1.2.3-70-g09d2