Allow search index starting points for additional sidebar files in nested folders
- Ngôn ngữ chính
- JavaScript
- Star
- 31.5k
- Fork
- 5.8k
- Merge trung bình
- 9 ngày 8 giờ
- Pull request đã merge (30 ngày)
- 2
Mô tả
## Feature request
#### What problem does this feature solve?
Search in Docsify works by indexing the top level sidebar content. This is fine, but as a set of documentation grows there will likely be folders added, and the sidebar continues to grow. In order to limit the growth of the sidebar, we can use nested _sidebar.md files in subfolders - problem solved.
If you then check the search index via inspecting your browser's local storage, you don't see any of the content from nested _sidebar.md files until you manually navigate to them. This is because Docsify is not loading these, which is expected behavior.
The search plugin allows an `auto` mode, or you can manually list the path to _every file in your documentation_ and they'll all be indexed. For large documentation sites this is not workable.
#### What does the proposed API look like?
It would be great if we had a new configuration option for search, where we could index `sidebarPaths` (or similar). These would not need to be indexed directly, but would be used as starting points for the index since they do contain links to everything accessible in that folder.
```
search : {
paths: 'auto',
sidebarPaths : [
'/folder'
'/team-guidelines'
]
}
```
#### How should this be implemented in your opinion?
With the above config, while still working in "auto" mode, instead of only looking at `/_sidebar.md` search would additionally look at `/folder/_sidebar.md` and `/team-guidelines/_sidebar.md`.
This should honor `loadSidebar` if configured, so that people can call their sidebar whatever they like but still search it.
#### Are you willing to work on this yourself?
Yes, but I'm not a very experienced Javascript developer so I'm likely not the best fit.
Hướng dẫn đóng góp
Hướng nghiên cứu
Start with the search plugin's auto mode and the sidebar loader, including how loadSidebar is honored; trace how nested _sidebar.md files currently enter the index. Done means the proposed sidebarPaths starting points are searched alongside the top-level sidebar without requiring manual navigation or listing every documentation file.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- javascript
- Lĩnh vực
- documentation, search
- Loại issue
- Tính năng
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 38/100