通过魔法,在搜索结果中展示API描述

This commit is contained in:
boybook
2025-03-19 16:24:54 +08:00
parent 672f8f2c32
commit 41635cf9bb
4 changed files with 171 additions and 1 deletions

View File

@@ -1,4 +1,5 @@
import { defineConfig } from 'vitepress';
import { fileURLToPath, URL } from 'node:url'
import generateSidebar from '../../scripts/sidebar.js';
import { withMermaid } from "vitepress-plugin-mermaid";
@@ -8,6 +9,19 @@ export default withMermaid({
title: "我的世界中国版 ModSDK",
description: "ModSDK 开发者文档 镜像,但提供更优质的搜索",
ignoreDeadLinks: true,
// 替换原生搜索组件,自定义展示的搜索结果内容
vite: {
resolve: {
alias: [
{
find: /^.*\/VPAlgoliaSearchBox\.vue$/,
replacement: fileURLToPath(
new URL('./theme/components/AlgoliaSearch.vue', import.meta.url)
)
}
]
}
},
locales: {
root: {
label: '简体中文',