ozum / vuepress-bar

VuePress sidebar and navbar generator based on file and directory structure. Focus your documents, not sidebar or navbar.
90 stars 40 forks source link

Packaged to VuePress plugin #6

Closed boboidream closed 4 years ago

boboidream commented 5 years ago
  1. Feature: Packaged to VuePress plugin. It's easier to use the plugin.
  2. Feature: Add pinyinNav to compatible with vuepress-plugin-permalink-pinyin.
  3. Fix issue: https://github.com/ozum/vuepress-bar/issues/5#issue-474089423
  4. Fix bug: When readme.md(not README.md) in folder throw error.
  5. Update readme.
  6. Update test.js.
ozum commented 5 years ago

@boboidream sorry for late answer. Github didn't sent me notifications for this repo.

First of all thanks for this PR. I could not pass all tests. Because lots of time passed since you posted, I did not bother you again, and I implemented some of the details by myself.

Please see latest version.

Implemented

Differently Implemented

Failing tests of this PR are related to sort feature. Your implementation sorts files directly by their name, but it cannot be applied here, because files may be sorted based on order attribute in meta data in markdown file (see line 96 in index.js). So, I added mixDirectoriesAndFilesAlphabetically option which puts directories in alphabetical positions.

Not Implemented yet (Have questions)

const getConfig = require("vuepress-bar");
const barConfig = getConfig(`${__dirName}/..`)

module.exports = {
  themeConfig: {
    nav: [{ text: 'External', link: 'https://google.com' }, ...barConfig.nav]
    sidebar: barConfig.sidebar,
  }
};

Question

Regarding #5, where is related changes, so I could fix it too.

Many thanks again.

ozum commented 4 years ago

Due to inactivity for a long time I'm closing this PR. Please feel free to reopen another case.