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

笔记中侧边栏的问题 #70

Closed
YTAZWC opened this issue Apr 24, 2024 · 4 comments
Closed

笔记中侧边栏的问题 #70

YTAZWC opened this issue Apr 24, 2024 · 4 comments

Comments

@YTAZWC
Copy link

YTAZWC commented Apr 24, 2024

你好,我按照指南中对笔记的侧边栏进行配置,配置内容如下所示

image

但是显示结果确实下面这样的,请问应该怎么配置呢?

image

@pengzhanbo
Copy link
Owner

从截图上看,应该是 配置与 目录结构没有对应上。 我不知道你的目录结构是如何的,因此此配置是否正确 无从推定。

但反过来,假设你的配置是正确的,那么你的目录结构应该是:

  ./{source Dir}
  | notes
     | 卡玛网刷题
        | 46.xxx
        | 54.xxx
        | 55.xxx

可以根据这个看看你的目录结构是否正确。 或者请给一个 目录结构树的截图 给我看下

@YTAZWC
Copy link
Author

YTAZWC commented Apr 25, 2024

我刚刚重新再对照了一下配置,按照主题源码里面,我加了一个dir的配置就可以了:
image
然后我的目录结构是下面这样的; README.md文件是在[卡码网刷题]目录下:
image
然后的话,结果是可以的:
image
但是,这样的话,我要如何显示单个目录呢?比如说下面这样,就是既有折叠的,也有单个一个的:
image

@pengzhanbo
Copy link
Owner

sidebar 数组中,插入的第一个元素为 '' 就可以了,主题会自动识别 '' 为 当前目录下的 README.md

sidebar: [
  '',
  { dir: '', items: [] },
]

@YTAZWC
Copy link
Author

YTAZWC commented Apr 25, 2024

好的,感谢,已经可以了🌹

@YTAZWC YTAZWC closed this as completed Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants