Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 2 additions & 58 deletions docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import vueJsx from '@vitejs/plugin-vue-jsx'
import { fileURLToPath } from 'url'
import { defineConfig } from 'vitepress'
import { vitepressDemoPlugin } from 'vitepress-demo-plugin'
import { themeConfig } from './themeConfig'

const { version } = pkg

Expand All @@ -18,48 +19,6 @@ const prodAlias = {
'@opentiny/tiny-robot-style': '@opentiny/tiny-robot/dist/style.css',
}

// 定义共享的侧边栏配置
const sharedSidebarItems = [
{
text: '指南',
base: '/guide/',
items: [
{ text: '快速开始', link: 'quick-start' },
{ text: '主题配置', link: 'theme-config' },
{ text: '更新日志', link: 'update-log' },
],
},
{
text: '组件',
base: '/components/',
items: [
{ text: 'Container 容器', link: 'container' },
{ text: 'Bubble 气泡', link: 'bubble' },
{ text: 'Sender 消息输入框', link: 'sender' },
{ text: 'Prompts 提示集', link: 'prompts' },
{ text: 'Welcome 欢迎', link: 'welcome' },
{ text: 'Feedback 气泡反馈', link: 'feedback' },
{ text: 'History 历史', link: 'history' },
{ text: 'DropdownMenu 下拉菜单', link: 'dropdown-menu' },
{ text: 'SuggestionPopover 建议弹出框', link: 'suggestion-popover' },
{ text: 'SuggestionPills 建议按钮组', link: 'suggestion-pills' },
{ text: 'DragOverlay 拖拽浮层', link: 'drag-overlay' },
{ text: 'Attachments 附件卡片', link: 'attachments' },
{ text: 'McpServerPicker 插件选择器', link: 'mcp-server-picker' },
{ text: 'Theme 主题', link: 'theme' },
],
},
{
text: '工具',
base: '/tools/',
items: [
{ text: 'AI模型交互工具类', link: 'ai-client' },
{ text: '消息数据管理', link: 'message' },
{ text: '会话数据管理', link: 'conversation' },
],
},
]

// https://vitepress.dev/reference/site-config
export default defineConfig({
title: 'TinyRobot',
Expand Down Expand Up @@ -105,22 +64,7 @@ export default defineConfig({
// https://vitepress.dev/reference/default-theme-config
logo: '/logo-mini.svg',
siteTitle: 'TinyRobot',
nav: [
{ text: '指南', link: '/guide/quick-start', activeMatch: '/guide/' },
{ text: '演示', link: '/examples/assistant', activeMatch: '/examples/' },
],
sidebar: {
'/guide/': sharedSidebarItems,
'/components/': sharedSidebarItems,
'/tools/': sharedSidebarItems,
'/examples/': [
{
text: '演示',
base: '/examples/',
items: [{ text: '综合示例', link: 'assistant' }],
},
],
},
...themeConfig,
search: {
provider: 'local',
},
Expand Down
61 changes: 61 additions & 0 deletions docs/.vitepress/themeConfig.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
// 定义共享的侧边栏配置
const sharedSidebarItems = [
{
text: '指南',
base: '/guide/',
items: [
{ text: '快速开始', link: 'quick-start' },
{ text: '主题配置', link: 'theme-config' },
{ text: '更新日志', link: 'update-log' },
],
},
{
text: '组件',
base: '/components/',
items: [
{ text: 'Container 容器', link: 'container' },
{ text: 'Bubble 气泡', link: 'bubble' },
{ text: 'Sender 消息输入框', link: 'sender' },
{ text: 'Prompts 提示集', link: 'prompts' },
{ text: 'Welcome 欢迎', link: 'welcome' },
{ text: 'Feedback 气泡反馈', link: 'feedback' },
{ text: 'History 历史', link: 'history' },
{ text: 'DropdownMenu 下拉菜单', link: 'dropdown-menu' },
{ text: 'SuggestionPopover 建议弹出框', link: 'suggestion-popover' },
{ text: 'SuggestionPills 建议按钮组', link: 'suggestion-pills' },
{ text: 'DragOverlay 拖拽浮层', link: 'drag-overlay' },
{ text: 'Attachments 附件卡片', link: 'attachments' },
{ text: 'McpServerPicker 插件选择器', link: 'mcp-server-picker' },
{ text: 'Theme 主题', link: 'theme' },
],
},
{
text: '工具',
base: '/tools/',
items: [
{ text: 'AI模型交互工具类', link: 'ai-client' },
{ text: '消息数据管理', link: 'message' },
{ text: '会话数据管理', link: 'conversation' },
],
},
]

const nav = [
{ text: '指南', link: '/guide/quick-start', activeMatch: '/guide/' },
{ text: '演示', link: '/examples/assistant', activeMatch: '/examples/' },
]

const sidebar = {
'/guide/': sharedSidebarItems,
'/components/': sharedSidebarItems,
'/tools/': sharedSidebarItems,
'/examples/': [
{
text: '演示',
base: '/examples/',
items: [{ text: '综合示例', link: 'assistant' }],
},
],
}

export const themeConfig = { nav, sidebar }