rescript-association / rescript-lang.org

Official documentation website for the ReScript programming language
https://rescript-lang.org
MIT License
1.86k stars 246 forks source link

Search results should display Git tag/docs version #245

Closed jthegedus closed 6 months ago

jthegedus commented 3 years ago

Problem

A search of switch will result in multiple results for seemingly the same thing, but in fact the results are for multiple versions of the rescript docs, this results in having the docs version changed when clicking on the wrong link and not easily knowing you did switch. The desired link is only known if you know the version of the docs you are on AND look at the URL listed by the browser (usually bottom-left of window) on hover.

This issue is amplified by the fact the older docs do not have Rescript syntax and for those who do not understand how or that they need to change the version can be cumbersome and lead to issues trying to understand why following the docs is leading to errors (EG: Rescript using array<> syntax over array())

rescript-docs-search-bug

Expected

The search should only list results for URLs of the currently selected version of the docs, or also specify the verison clearly in the results.

This may not be easily resolved :shrug:

PS: Rescript is awesome, thanks for all your work.

ryyppy commented 3 years ago

I think we should instruct Algolia to only index the /docs/manual/latest docs here. Probably generating a Sitemap would also help 🤦‍♂️

ryyppy commented 3 years ago

Had a look at algolia's configuration setup. Notes for myself: