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

Display directory heading in search results #3192

Open
4 tasks done
JingboLi99 opened this issue Nov 6, 2023 · 2 comments · May be fixed by #3440
Open
4 tasks done

Display directory heading in search results #3192

JingboLi99 opened this issue Nov 6, 2023 · 2 comments · May be fixed by #3440
Assignees
Labels
enhancement New feature or request stale theme Related to the theme

Comments

@JingboLi99
Copy link

Is your feature request related to a problem? Please describe.

Currently, the search results only display the page title and anchors (if any) in which the results appear in. I have many similar page titles for different contexts, which are organized as different sidebar directories. Without being able to see which sidebar directory a page is in, it can get confusing as to which page I am looking at.

Describe the solution you'd like

It will be nice to be able to see which sidebar sub-directory the pages are in, as is the case for Vuepress's built-in search option. Would it be possible to add an option to configure what fields to display in the search bar results in themeConfig?
image

Describe alternatives you've considered

I have looked at the existing search options, but none seem to offer this functionality.

Additional context

No response

Validations

@brc-dd
Copy link
Member

brc-dd commented Nov 7, 2023

Can you please explain what are you trying to do? For example, this is the result on UnoCSS docs: It clearly shows the full path even if the heading names are similar.

image

@JingboLi99
Copy link
Author

Using the UnoCSS example, when I search for something (e.g. built-in features) under the CLI section under the Integrations directory, I would like to see that the result in under the Integration directory. Something like Integrations > CLI > Built-in features
image
Right now, it just shows CLI > # Built-in features. In the Vuepress search example I gave, it shows the directory title in the green portion, and the page and page anchor path in each individual search result. I wish Vitepress also had that functionality.
image

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

Successfully merging a pull request may close this issue.

3 participants