Skip to content

Commit

Permalink
feat: 目录 & sidebar 调整
Browse files Browse the repository at this point in the history
  • Loading branch information
Mooo-star committed Jul 19, 2024
1 parent 7068f63 commit 69bf388
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .dumirc.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { defineConfig } from 'dumi';
import nav from './config/nav';
import sidebar from './config/sidebar';

export default defineConfig({
fastRefresh: true,
Expand All @@ -12,5 +13,9 @@ export default defineConfig({
logo: false,
footer: 'Copyright © 2024 | Powered by Mooo',
nav,
sidebar,
socialLinks: {
github: 'https://github.com/Mooo-star/blog',
},
},
});
1 change: 1 addition & 0 deletions config/nav/fragment/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ import typescript from './typescript';

export default {
title: '知识碎片「部分转载」',
link: '/fragment',
children: [...typescript, ...leetcode],
};
5 changes: 1 addition & 4 deletions config/nav/index.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
import { defineConfig } from 'dumi';
import engineer from './engineer';
import fragment from './fragment';
import node from './node';
import react from './react';

type Nav = ReturnType<typeof defineConfig>;

const nav: Nav = [fragment, engineer, react, node];
const nav = [fragment, engineer, react, node];

export default nav;
20 changes: 20 additions & 0 deletions config/sidebar/fragment/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
export default [
{
title: '算法',
children: [
{
title: '回溯',
link: '/leetcode/backtrack',
},
],
},
{
title: 'TypeScript',
children: [
{
title: '内置类型',
link: '/typescript/build-in-type',
},
],
},
];
7 changes: 7 additions & 0 deletions config/sidebar/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import fragmentNav from './fragment';

export default {
'/fragment': fragmentNav,
'/leetcode': fragmentNav,
'/typescript': fragmentNav,
};
3 changes: 3 additions & 0 deletions docs/fragment/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## 介绍

该目录下的文章用来记录平时的想到的一些知识碎片
4 changes: 2 additions & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ hero:
title: Mooo's blog
description: 记录前端每一点
actions:
- text: 现在开始
link: ./engineer
# - text: 现在开始
# link: ./engineer
- text: View on GitHub
link: https://github.com/Mooo-star
---

0 comments on commit 69bf388

Please sign in to comment.