Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

实现基于文件夹的分类 #292

Closed
peigoz opened this issue Jan 11, 2021 · 4 comments
Closed

实现基于文件夹的分类 #292

peigoz opened this issue Jan 11, 2021 · 4 comments
Labels
suggestion New feature or request

Comments

@peigoz
Copy link

peigoz commented Jan 11, 2021

Feature request

  1. 文章过多时,在docs下有web,server,team..各个文件夹,能否在nav的items中设置基于文件夹的路径名称,之后点击分类下的前端会根据web文件夹中各个a.md,b.md,c.md文件的categories实现2级分类。
//项目目录结构
├── docs
│   ├── .vuepress (可选的)
│   ├── README.md
│   ├── web
│   │   └── a.md
│   │   └── b.md
│   │   └── c.md
│   ├── server
│   │   └── d.md
│   │   └── e.md
│   │   └── f.md
│   ├── team
│   │   └── g.md
│   │   └── h.md
└── package.json
//nav配置
nav = [
 { text: '首页', link: '/', icon: 'reco-home' },
 {
   text: '分类',
   icon: 'reco-category',
   items: [
     {
       text: 'Group1',
       items: [
         { text: '前端', link: '/web/ ' },
         { text: '后端', link: '/server/' },
         { text: '团队协作', link: '/team/' },
       ],
     },
   ],
 },
 { text: '标签', link: '/tag/', icon: 'reco-tag' }
]
//a.md中frontmatter内容
categories:
- css
//b.md中frontmatter内容
categories:
- javascript

What problem does this feature solve?

  1. 实现基于文件夹下管理多个文章,便于后续管理

What does the proposed API look like?

  1. 好像hexo有通过在frontmatter多设置一个type变量表示文件夹

How should this be implemented in your opinion?

  1. categories页面上方的标签是根据frontmatter中的categories进行归档的,能否在编译阶段根据md文件所在的文件夹去生成router页面,或者多加一个type变量根据type在categories的基础上多一层分类

Are you willing to work on this yourself?

@recoluan recoluan added the suggestion New feature or request label Jan 12, 2021
@recoluan
Copy link
Member

👍,很不错的建议,但是目前精力有限,很多想法都在 delay,你是不是愿意做一下调研呢?

@peigoz
Copy link
Author

peigoz commented Jan 12, 2021

👍,很不错的建议,但是目前精力有限,很多想法都在 delay,你是不是愿意做一下调研呢?

没有调研这方面的经验,不好意思,不过这种功能可以参考一下类似的博客,好像挺多使用的,官方会基于文件夹生成对应的链接也是基于这种需求吧。

@ATQQ
Copy link
Contributor

ATQQ commented Feb 10, 2021

这个可以自己写脚本按目录扫就行了,我目前就是这样的,主题应该不会做这种强绑定的feature,你也可以自己做个插件

@recoluan
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
suggestion New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants