nushell / nushell.github.io

Nushell's main website, blog, book, and more
https://www.nushell.sh/book/
MIT License
167 stars 409 forks source link

Doc search should not show deprecated results #536

Open ammkrn opened 2 years ago

ammkrn commented 2 years ago

Describe the bug

The search feature in the book/docs returns misleading results about deprecated versions. If I search 'startup', the first result is Startup commands (jonathandturner), which is very outdated. The URL does indicate that this is old, but that's not part of the search result, and you have to scroll to the top of the page to see the version number (and you'd already have to be a user to know that this is not the newest version).

Thank you.

How to reproduce

Navigate to https://www.nushell.sh/ and search for startup

Expected behavior

I guess the expectation is that the search function would only draw from docs that are current relative to the latest version.

Screenshots

No response

Configuration

No response

Additional context

No response

fdncred commented 2 years ago

Transferred to docs repo, as it seems a better fit.

Excluding the deprecated commands shouldn't be that tricky as we just need to stop generating the md files for them. However, filtering out blogs may not be the best thing. I agree that they can contain outdated material but they also can contain good information. So, that's a tougher thing to deal with.

ammkrn commented 2 years ago

@fdncred

Thanks for taking a look. It might be more intuitive if the search bar returned results from the book when the "book" tab is active, and results from the blog when that tab is active. Currently, the search prompt just says "search docs" regardless of what tab is active and returns results from any of them, which I think is unexpected for people used to cargo docs/mdbook stuff in the rust ecosystem.

fdncred commented 2 years ago

That sounds interesting. We'd probably accept a PR for that functionality.