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

Documents with the same title appear under the same category in search results #155

Open
sgerace opened this issue Sep 27, 2024 · 1 comment

Comments

@sgerace
Copy link

sgerace commented Sep 27, 2024

First, thanks for creating such a great library! 😄 👍

Second, we have a site with several pages with duplicate titles nested under different parents; for example:

Topic A
  - Design
  - Implementation
Topic B
  - Design
  - Implementation

When searching, if a keyword appears in multiple "Design" documents, the search results look like this:

Screenshot 2024-09-27 at 12 25 49 PM

Notice how both documents are listed under a single "Design" category, even though they are actually part of two separate documents.

It would be great if the category could include the parent titles for nested documents. For example, I'd love to see the above be displayed as:

Screenshot 2024-09-27 at 12 33 14 PM

@gnidan
Copy link

gnidan commented Dec 12, 2024

I'm running into this same problem. I thought of a potential workaround that unfortunately still doesn't work: using front matter to specify page titles. Something like:

---
sidebar_position: 1
sidebar_label: Overview
title: First Topic Overview
---

# Overview

Unfortunately, it seems like this plugin uses the h1 as the sole source of information for the page title, preventing this approach from working.

If the maintainers here are interested in addressing this issue, perhaps the page title searching logic could change to use the front matter title property first, then the h1 if the property isn't defined.

Another approach I've thought of would be to add an option to this plugin to generate page titles with full breadcrumbs, but this seems maybe a bit wonkier vs. using front matter.

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