Skip to content

Commit 84e910f

Browse files
committed
Update: 主题首页
1 parent 85fafca commit 84e910f

File tree

63 files changed

+706
-753
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+706
-753
lines changed

.vitepress/config.ts

Lines changed: 3 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
import { defineConfig } from 'vitepress';
22
import taskLists from 'markdown-it-task-lists';
33
import mathjax3 from 'markdown-it-mathjax3';
4-
import learnSidebar from './sidebar/learn';
5-
import bugsSidebar from './sidebar/bugs';
6-
import testSidebar from './sidebar/test';
7-
import { qqGroupIcon } from './sidebar/icons';
84
import UnoCSS from 'unocss/vite';
95
import path from 'path';
6+
import themeConfig from './themeConfig';
107

118
const customElements: string[] = [ 'mjx-container' ];
129

@@ -26,6 +23,7 @@ export default defineConfig({
2623
resolve: {
2724
alias: {
2825
'@': path.join(__dirname, '../src/'),
26+
'@img': path.join(__dirname, '../src/public/images/'),
2927
'@NanoUI': path.join(__dirname, '../package/components/'),
3028
'@NanoIcon': path.join(__dirname, '../package/icon/'),
3129
'@store': path.join(__dirname, '../package/store/')
@@ -67,73 +65,5 @@ export default defineConfig({
6765
},
6866
lastUpdated: true,
6967
// 主题配置
70-
themeConfig: {
71-
search: {
72-
provider: 'local',
73-
options: {
74-
translations: {
75-
button: {
76-
buttonText: '搜索文档',
77-
buttonAriaLabel: '搜索文档'
78-
},
79-
modal: {
80-
noResultsText: '无法找到相关结果',
81-
resetButtonTitle: '清除查询条件',
82-
displayDetails: '显示详细信息',
83-
footer: {
84-
selectText: '选择',
85-
navigateText: '切换',
86-
closeText: '关闭'
87-
}
88-
}
89-
}
90-
}
91-
},
92-
footer: {
93-
message: 'Released under the MIT License. <br/> Copyright © 2022-present Tmiracle',
94-
copyright: '<a target="_blank" href="https://beian.miit.gov.cn/#/Integrated/index">桂ICP备2022008261号-1</a>'
95-
},
96-
socialLinks: [
97-
{ icon: 'github', link: 'https://github.com/T-miracle' },
98-
{ icon: { svg: qqGroupIcon }, link: 'https://jq.qq.com/?_wv=1027&k=YX3jUWQe' }
99-
],
100-
lastUpdated: {
101-
text: '上次更新于'
102-
},
103-
sidebarMenuLabel: '菜单',
104-
returnToTopLabel: '返回顶部',
105-
darkModeSwitchLabel: '切换白天/黑夜主题',
106-
docFooter: {
107-
prev: '上一篇',
108-
next: '下一篇'
109-
},
110-
nav: [
111-
{ text: '我的知识库', link: '/learn/' },
112-
{ text: '文档翻译', link: '/translation-docs/' },
113-
{ text: '资源导航', link: '/nav/' },
114-
{
115-
text: '更多内容',
116-
items: [
117-
{ text: '问题处理', link: '/bugs/' },
118-
{ text: '测试题', link: '/test/' },
119-
{ text: '杂谈', link: '/tittle-tattle/' }
120-
// { text: '面试与笔试模拟', link: '/simulation/' }
121-
]
122-
}
123-
],
124-
// 左上角标题图标
125-
logo: '/logo.png',
126-
outline: {
127-
// 右侧导航目录显示层级
128-
level: 'deep',
129-
// 右侧导航目录显示文字
130-
label: '导航栏'
131-
},
132-
// 左侧栏目录配置
133-
sidebar: {
134-
'/learn/': learnSidebar,
135-
'/bugs/': bugsSidebar,
136-
'/test/': testSidebar
137-
}
138-
}
68+
themeConfig
13969
});

.vitepress/sidebar/bugs.ts

Lines changed: 28 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,77 @@
1-
import { DefaultTheme } from 'vitepress/types/default-theme';
21
import { bugIcon, elementIcon, htmlIcon, tsIcon, uniAppIcon, webIcon } from './icons';
2+
import { type SidebarType } from '../../package/type';
33

4-
const bugsSidebar: DefaultTheme.SidebarItem[] = [
4+
const bugsSidebar: SidebarType[] = [
55
{
6-
text: bugIcon + 'BUG处理',
6+
icon: bugIcon,
7+
text: 'BUG处理',
78
link: '/bugs/',
89
items: []
910
},
1011
{
11-
text: webIcon + '前端',
12+
icon: webIcon,
13+
text: '前端',
1214
collapsed: false,
1315
items: [
14-
1516
{
16-
text: htmlIcon + 'HTML',
17+
icon: htmlIcon,
18+
text: 'HTML',
1719
collapsed: true,
1820
items: [
1921
{
20-
text: '🔹img 标签加载对象存储图片后再使用 canvas 调用当前图片,导致图片跨域的问题',
22+
icon: '🔹',
23+
text: 'img 标签加载对象存储图片后再使用 canvas 调用当前图片,导致图片跨域的问题',
2124
link: '/bugs/web/html/canvas-use-object-storage-image-cross-domain'
2225
}
2326
]
2427
},
2528
{
26-
text: tsIcon + 'TypeScript',
29+
icon: tsIcon,
30+
text: 'TypeScript',
2731
collapsed: true,
2832
items: [
2933
{
30-
text: '🔹代码警告:TS2307: Cannot find module \'xxx\' or its corresponding type declarations.',
34+
icon: '🔹',
35+
text: '代码警告:TS2307: Cannot find module \'xxx\' or its corresponding type declarations.',
3136
link: '/bugs/web/typescript/warning_ts2307'
3237
}
3338
]
3439
},
3540
{
36-
text: elementIcon + 'Element-UI & Element-Plus',
41+
icon: elementIcon,
42+
text: 'Element-UI & Element-Plus',
3743
collapsed: true,
3844
items: [
3945
{
40-
text: '🔹MessageBox报错Uncaught (in promise) cancel',
46+
icon: '🔹',
47+
text: 'MessageBox报错Uncaught (in promise) cancel',
4148
link: '/bugs/web/element-ui/messagebox_report_error_uncaught_(in_promise)_cancel'
4249
},
4350
{
44-
text: '🔹Error: for nested data item, row-key is required.',
51+
icon: '🔹',
52+
text: 'Error: for nested data item, row-key is required.',
4553
link: '/bugs/web/element-ui/table_tree_json_error'
4654
},
4755
{
48-
text: '🔹头像组件第一次地址加载报错后,数据再次获取后无法重新加载',
56+
icon: '🔹',
57+
text: '头像组件第一次地址加载报错后,数据再次获取后无法重新加载',
4958
link: '/bugs/web/element-ui/el-avatar_not_update_after_refetching_the_data'
5059
},
5160
{
52-
text: '🔹el-form 自定义一个非输入选择的值的规则,但是无法生效的问题',
61+
icon: '🔹',
62+
text: 'el-form 自定义一个非输入选择的值的规则,但是无法生效的问题',
5363
link: '/bugs/web/element-ui/el-form_customize_rule'
5464
}
5565
]
5666
},
5767
{
58-
text: uniAppIcon + 'uni-app',
68+
icon: uniAppIcon,
69+
text: 'uni-app',
5970
collapsed: true,
6071
items: [
6172
{
62-
text: '🔹新安装包覆盖安装,新增加的页面无法跳转',
73+
icon: '🔹',
74+
text: '新安装包覆盖安装,新增加的页面无法跳转',
6375
link: '/bugs/web/uniapp/overwrite_install_newly_added_page_cannot_jump'
6476
}
6577
]

0 commit comments

Comments
 (0)