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

[Bug]: 非markdown文件在特定情况下会被写入到侧边栏目录中 #1349

Closed
KunerRick opened this issue Aug 22, 2024 · 1 comment · Fixed by #1369
Closed

[Bug]: 非markdown文件在特定情况下会被写入到侧边栏目录中 #1349

KunerRick opened this issue Aug 22, 2024 · 1 comment · Fixed by #1369
Labels
🐞 bug Something isn't working

Comments

@KunerRick
Copy link

版本信息

System:
    OS: Windows 10 10.0.18363
    CPU: (8) x64 Intel(R) Core(TM) i5-10210U CPU @ 1.60GHz
    Memory: 8.22 GB / 15.83 GB
  Browsers:
    Edge: Spartan (44.18362.1533.0)
    Internet Explorer: 11.0.18362.1
  npmPackages:
    rspress: ^1.28.0 => 1.28.1

问题详情

背景

因为现有markdown文档较多,我在尝试通过Typescript 脚本来遍历 docs下的文档,然后动态更新 目录下的_meta.json中的配置。

出现问题

部分markdown文档目录下,单独创建了imgs目录来存放所要引用的图片,此时外层目录已经生成了_meta.json,而imgs目录中由于没有markdown文档,因此并未生成_meta.json,结构大致如下:
image
其中_meta.json 如下

[
  "index",
  {
    "type": "dir",
    "name": "imgs",
    "label": "没有Markdown"
  }
]

构建完成后,侧边栏目录表现为
image
但这个1其实 是 图片。

期望

类似的,子级目录如果没有指定_meta.json ,是否也不应该将 里面的非md文件添加到侧边目录呢?
或者有没有什么配置可以规避此类问题?

复现链接

https://codesandbox.io/p/devbox/bold-dew-dyn243

复现步骤

  1. 调整目录 和 _meta.json 如下图
  2. image
  3. 执行构建
  4. 查看侧边栏目录
    5.在 codeSandbox 中表现如下
    image
@KunerRick KunerRick added the 🐞 bug Something isn't working label Aug 22, 2024
@Timeless0911
Copy link
Collaborator

same as #1327

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working
Projects
None yet
2 participants