Skip to content

Commit

Permalink
refactor: 💡 refactor nav
Browse files Browse the repository at this point in the history
  • Loading branch information
huyikai committed Dec 6, 2023
1 parent 68fbea7 commit 3f62f00
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 11 deletions.
4 changes: 2 additions & 2 deletions example/.vitepress/config.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// import treeToArray from 'tree-conver';
import treeToArray from 'tree-conver';
import vitepressHelper from '@huyikai/vitepress-helper';
export default async () => {
const instance: any = await vitepressHelper({
directory: 'example'
});
// console.log('treeToArray', treeToArray([]));
console.log('treeToArray', treeToArray([]));
return {
base: '/vitepress-helper/',
title: 'vitepres-helper',
Expand Down
2 changes: 1 addition & 1 deletion packages/@huyikai/vitepress-helper/lib/index.esm.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/@huyikai/vitepress-helper/lib/index.esm.js.map

Large diffs are not rendered by default.

8 changes: 3 additions & 5 deletions packages/@huyikai/vitepress-helper/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"fs-extra": "^10.1.0",
"globby": "^11.0.1",
"gray-matter": "^4.0.2",
"uuid": "^9.0.1"
"uuid": "^9.0.1",
"tree-conver": "^0.0.95"
},
"description": "enhance vitepress experience",
"devDependencies": {
Expand All @@ -35,9 +36,6 @@
"main": "lib/index.esm.js",
"module": "lib/index.esm.js",
"name": "@huyikai/vitepress-helper",
"peerDependencies": {
"tree-conver": "^0.0.94"
},
"publishConfig": {
"access": "public"
},
Expand All @@ -52,4 +50,4 @@
"type": "module",
"types": "lib/types/index.d.ts",
"version": "0.0.1"
}
}
4 changes: 2 additions & 2 deletions packages/@huyikai/vitepress-helper/src/nav.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { InitParams } from './../types/init';
// import { treeToArray } from 'tree-conver';
import { treeToArray } from 'tree-conver';
// import { tree2array } from '@axolo/tree-array';
interface NavParams extends InitParams {
pages: Array<{ link: string }>;
Expand Down Expand Up @@ -60,7 +60,7 @@ export default (params: NavParams) => {
};
const tree = generateTree(links);
console.log(JSON.stringify(tree));
// console.log(treeToArray(tree));
console.log(treeToArray(tree));
// console.log(tree2array(tree));
// for (let a of pagesFiltered) {
// let link = a.link.split(`${directory}/`)[1];
Expand Down

0 comments on commit 3f62f00

Please sign in to comment.