linkerd / website

Source code for the linkerd.io website
Apache License 2.0
44 stars 212 forks source link

Add search functionality to the documentation section #1156

Open obrienrobert opened 3 years ago

obrienrobert commented 3 years ago

The documentation section of the website contains drop-down menus with links to various sections. It would be nice if there was a way of searching through the documentation without having to click on the drop-downs and manually looking for a specific section. Maybe a search bar that dynamically filters the results as the user enters text?

cpretzer commented 3 years ago

thanks @obrienrobert that's a great suggestion. The Linkerd docs use hugo to generate a static site, so are you familiar with any plugins or projects that can be added in a PR?

obrienrobert commented 3 years ago

@cpretzer unfortunately, I do not, as it's an area I am not familiar with. A quick Google lead me to https://lunrjs.com/. I'm sure there are more, but this seems like a popular method of implementing a search feature within a static Hugo site.

importhuman commented 3 years ago

@cpretzer The official Hugo website mentions some search options. Also, buildpacks docs are built with Hugo as well and feature a dynamic search bar, but I couldn't determine if any of the search options is being used. As far as I can tell, it utilizes a custom function with some scripts imported in the default layout.

importhuman commented 3 years ago

Found the library used in buildpacks docs for dynamic search, but it requires the website owners to sign up: https://docsearch.algolia.com/

Should I try to add the search feature with one of the options mentioned in the official Hugo docs?