vuepress/vuepress-plugin-blog

Is multi-level classification supported ???

Closed this issue · 4 comments

Feature request

What problem does this feature solve?

Is multi-level classification supported ?

What does the proposed API look like?

How should this be implemented in your opinion?

Are you willing to work on this yourself?

Could you elaborate more on this? And which scenarios are this feature requested for?

@newsbielt703 If there are many classifications now, I want to group them. How can I do this??
for example
image

Currently, I think you can implement it with frontmatter classifier:

frontmatters: [
        {
          id: "web",
          keys: ['web'],
          path: '/web/',
        },
        {
          id: "mobile",
          keys: ['mobile'],
          path: '/mobile/',
        }
      ],

Will it meet your needs?

@newsbielt703
Thank you. It can't be satisfied. This configuration can't group classifications

I have realized my current requirements by combining your configuration and custom config.js

noteConfig: {
      // 来创建左侧菜单
      nav: [
        // 通过以下方式可以获取到相应的文章内容
        // _this['$'+_this.$themeConfig.noteConfig.nav[0].frontmatter.id].map[_this.$themeConfig.noteConfig.nav[0].frontmatter.key]
        {
          text: "语言", // 左侧栏名称
          icon: "iconqq",
          frontmatter: {
            // 指定frontmatter内容
            id: "categories", // 指向vuepress-plugin-blog中的frontmatter
            key: "front" // Markdown中的frontmatter配置的categories值
          }
        },
        {
          text: "标签",
          icon: "iconqq",
          frontmatter: { id: "tags" }, // 通过这种方式进行分组设置
          items: [
            { text: "Vue", icon: "iconqq", frontmatter: { key: "Vue" } },
            { text: "Java", icon: "iconqq", frontmatter: { key: "Java" } },
            { text: "Vuepress", icon: "iconqq", frontmatter: { key: "Vuepress" } }
          ]
        },
        {
          text: '目录',
          icon: 'iconqq',
          link: '', // 手动指定link优先选择
          frontmatter: { id: "tags" }, // 通过这种方式进行分组设置
          items: [
            { text: "Vue", icon: "iconqq", link: '', frontmatter: { key: "Vue" } },
            { text: "Java", icon: "iconqq", frontmatter: { key: "Java" } },
            { text: "Vuepress", icon: "iconqq", link:'', frontmatter: { key: "Vuepress" } }
          ]
        }
      ]
    }