Skip to content

Commit 7a55f95

Browse files
committed
update: 修改文件 🥳
1 parent 85d0f61 commit 7a55f95

File tree

6 files changed

+32
-7
lines changed

6 files changed

+32
-7
lines changed

Diff for: docs/.vitepress/scripts/sidebar.ts

+9-6
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ const CSSOptions: Record<string, { text: string; order: number }> = {
3838
};
3939
/**
4040
* @description: 生成侧边栏
41-
* todo: warning
4241
*/
4342
const generateSidebar = (
4443
cwd: string,
@@ -50,11 +49,15 @@ const generateSidebar = (
5049
const result = files.map((file) => {
5150
const path = file.replace(/(\/index)?\.md$/, "");
5251
const key = path.replace(/\/$/, "").split("/").pop();
53-
return {
54-
text: (options[key] && options[key].text) || key,
55-
link: `/${prefix}/${path}`,
56-
order: (options[key] && options[key].order) || 0,
57-
};
52+
if (options[key]) {
53+
return {
54+
text: options[key].text,
55+
link: `/${prefix}/${path}`,
56+
order: options[key].order,
57+
};
58+
} else {
59+
console.warn(`warning: [sidebar.ts/${prefix}] ${key} not in options`);
60+
}
5861
});
5962
return [introduction, ...result].sort((a, b) => a.order - b.order);
6063
};

Diff for: docs/basic/browser/introduction.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
---
2+
next: false
3+
prev: false
4+
---
5+
16
::: tip
27
浏览器缓存、存储、跨域、安全、渲染等内容。
38
:::

Diff for: docs/basic/code/introduction.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
# Introduction
1+
---
2+
next: false
3+
prev: false
4+
---
25

36
:::tip
47
Javascript 常见的代码

Diff for: docs/basic/network/introduction.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
---
2+
next: false
3+
prev: false
4+
---
5+
16
::: tip
27
计算机网络
38
:::

Diff for: docs/css/introduction.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
---
2+
next: false
3+
prev: false
4+
---
5+
16
<script setup>
27
import CssIntroduction from '~/pages/css-introduction.vue'
38
</script>

Diff for: docs/javascript/introduction.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
---
2+
next: false
3+
---
4+
15
# Introduction
26

37
> JavaScript 是前端的核心技术。

0 commit comments

Comments
 (0)