dumi icon indicating copy to clipboard operation
dumi copied to clipboard

bug: menu render unexpect when docs dir path include `enum`

Open Saber2pr opened this issue 4 years ago • 7 comments

Versions

  • dumi:1.1.26
  • node:14.16.1
  • npm:6.14.12
  • OS:MacBook Pro (13-inch, M1, 2020)
  • Browser:Google Chrome 93.0.4577.63 (arm64)

Steps to reproduce

  1. Create a folder named with enum in the docs directory, like this:
docs
├── docs
│   └── enum
│       ├── ListCard.en.md
│       └── ListCard.md
├── index.en.md
└── index.md

With locale config:

locales: [
  ['zh', '中文'],
  ['en', 'English'],
],
  1. Click locale bar changing current language, enum menu render error:

Living demo: https://saber2pr-umi.github.io/test-dumi-enum/en/docs/enum/list-card

Demo source code: https://github.com/saber2pr-umi/test-dumi-enum

What is Expected?

  • The menu path can contain enum words

  • In Chinese, only the Chinese menu is displayed

  • In English, only the English menu is displayed

What is actually happening?

living.gif

Saber2pr avatar Sep 11 '21 02:09 Saber2pr

目测是因为文件夹的名称与 locales 的匹配引起的问题

cnyballk avatar Sep 12 '21 18:09 cnyballk

Hello @Saber2pr. We totally like your proposal/feedback, welcome to send us a Pull Request for it. Please be sure to fill in the default template in the Pull Request, provide changelog/documentation/test cases if needed and make sure CI passed, we will review it soon. We appreciate your effort in advance and looking forward to your contribution!

你好 @Saber2pr,我们完全同意你的提议/反馈,欢迎直接在此仓库创建一个 Pull Request 来解决这个问题。请务必填写 Pull Request 内的预设模板,提供改动所需相应的 changelog、测试用例、文档等,并确保 CI 通过,我们会尽快进行 Review,提前感谢和期待您的贡献。

github-actions[bot] avatar Sep 13 '21 02:09 github-actions[bot]

v1.1.27 已修复

PeachScript avatar Sep 14 '21 07:09 PeachScript

试了下 v1.1.28 有新的问题,issue reopen

PeachScript avatar Sep 15 '21 03:09 PeachScript

试了下 v1.1.28 有新的问题,issue reopen

是的。。menu分组有新的问题。

Saber2pr avatar Sep 15 '21 03:09 Saber2pr

v1.1.29 应该是真修复了,可以试试看

PeachScript avatar Sep 17 '21 10:09 PeachScript

v1.1.29 应该是真修复了,可以试试看

路径和多语言冲突确实是解决了。不过貌似group分组有点问题==,是这样:

docs
├── docs
│   └── enum
│       ├── ButtonCard.en.md # 没有group title
│       ├── ButtonCard.md # 没有group title
│       ├── ListCard.en.md # 加了group title
│       ├── ListCard.md # 加了group title
│       ├── ListCard2.en.md # 没有group title
│       └── ListCard2.md # 没有group title
├── index.en.md
└── index.md

渲染出来的:

bug-group

如果每个markdown都补上group就OK,1.1.26和之前的貌似是一个文件夹下有一个md文件写了group就可以..

  • 在线demo地址:https://saber2pr-umi.github.io/test-dumi-enum/docs/enum/button-card
  • demo源码:https://github.com/saber2pr-umi/test-dumi-enum

Saber2pr avatar Sep 17 '21 11:09 Saber2pr