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

自定义页面禁用侧边栏时不展示 Content 容器 #1789

Closed
envylover opened this issue Jul 27, 2023 · 2 comments · Fixed by #1794
Closed

自定义页面禁用侧边栏时不展示 Content 容器 #1789

envylover opened this issue Jul 27, 2023 · 2 comments · Fixed by #1794
Labels
enhancement New feature or request

Comments

@envylover
Copy link

Versions

  • dumi:2.2.1
  • node: 16
  • npm: 16.20.0
  • OS: mac os
  • Browser: edge

Steps to reproduce

目录结构:

  • dumi
    • pages
      • test
        • 1
        • 2
        • index.tsx
        • utils.ts

What is Expected?

/test 是应该渲染React页面

What is actually happening?

实际效果会在页面内容还会创建dumi-default-content,且侧边栏中展示
1
2
utils

当test为Test时不会出现此现象。
自定义页面应当不需要展示dumi侧边栏

@envylover envylover added the bug Something isn't working label Jul 27, 2023
@PeachScript
Copy link
Member

当test为Test时不会出现此现象

我本地验证下来和大小写无关,都会展示侧边栏

自定义页面应当不需要展示dumi侧边栏

dumi 没有这个设定,自定义页面也是可以有侧边栏的,这样才能和普通 md 生成的内容结构融合在一起

如果不需要侧边栏,给自定义页面最顶部加上 FrontMatter 配置 sidebar: false 即可,配置项文档:https://d.umijs.org/theme/default#sidebar-1 ,代码示例:

/**
 * sidebar: false
 */

// 自定义页面的具体代码实现

但这里应该有个优化点,手动禁用 sidebar 的时候应该和首页一致不展示 Content 容器,下个版本会调整下

@PeachScript PeachScript changed the title bug: .dumi/pages目录下的一级目录,当为小写开头时在侧边栏显示该目录下所有文件/目录 自定义页面禁用侧边栏时不展示 Content 容器 Jul 27, 2023
@PeachScript PeachScript added enhancement New feature or request and removed bug Something isn't working labels Jul 27, 2023
@PeachScript
Copy link
Member

但这里应该有个优化点,手动禁用 sidebar 的时候应该和首页一致不展示 Content 容器,下个版本会调整下

v2.2.2 已调整

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

Successfully merging a pull request may close this issue.

2 participants