Skip to content

Commit

Permalink
feat: 新增 autoPrev、autoNext 丢失提示
Browse files Browse the repository at this point in the history
  • Loading branch information
shanyuhai123 committed Jun 17, 2020
1 parent 7a13d37 commit 5086329
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
const fs = require('fs');
const path = require('path');

const colors = require("colors/safe");
const { getMenuPath, getFilename, filterRootMarkdowns, groupBy, genSidebar, titleSort, sidebarSort, findGroupIndex, genNav } = require("./lib/utils");
const sidebarOptions = require("./lib/options");

Expand Down Expand Up @@ -43,6 +45,10 @@ module.exports = (options, ctx) => ({
}
}

if (sortQueueCache.length) {
console.log(colors.red("\nvuepress plugin auto sidebar(精准排序): "), `\n [${colors.green(sortQueueCache.map(q => `${q.filename}(${q.frontmatter.title})`).join("、"))}] \t共 ${sortQueueCache.length} 个文件指向了不存在的 prev 或 next`);
}

SIDEBAR = genSidebar(sidebarSort(groupByDepth), mergeOptions);

const nav = genNav(SIDEBAR);
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,8 @@
"homepage": "https://github.com/shanyuhai123/vuepress-plugin-auto-sidebar#readme",
"devDependencies": {
"jest": "^25.1.0"
},
"dependencies": {
"colors": "^1.4.0"
}
}

0 comments on commit 5086329

Please sign in to comment.