kind icon indicating copy to clipboard operation
kind copied to clipboard

Add site search to main page

Open mehabhalodiya opened this issue 3 years ago • 3 comments
trafficstars

This is a Feature Request I'd like to start a search in the documentation.

What would you like to be added: Add a facility to search the content on the main page, https://kind.sigs.k8s.io/ Add a link to the docs default search engine.

Why is this needed: Let's say someone arrives at kind.sigs.k8s.io/ and wants to find out about updating generated code in kind. The trouble is there's no form on kind.sigs.k8s.io/ to do that search, and it's not obvious that navigating round the site will reveal that search.

Comment: Consider both desktop and mobile browser use cases. The main page is some readers' first impression of kind, so it's important to make a good one.

From an implementation perspective (from what I can tell) the site can use a custom google search engine.

The first step would be identifying who the admin(s) of that are. The second step would be identifying what directories are scanned The third step would be including the pages we now want to include. The fourth step is fairly easy – add partials/search_input.html to the layout template you want to see a search box on.

It may be nice to develop categories to tag the content and provide different ways to display the entries.

mehabhalodiya avatar Apr 09 '22 12:04 mehabhalodiya

For now I would recommend using something like site:kind.sigs.k8s.io in e.g. google search.

I'm not sure if the Kubernetes project has an accepted approach for this in subprojects. This sounds like a nice feature.

Let's say someone arrives at kind.sigs.k8s.io/ and wants to find out about updating generated code in kind.

For this specific use-case, I hope folks read the contributor guide in full 😅

cc @jimangel @sftim (sorry! not sure who else to reach out to 😅 )

BenTheElder avatar Apr 19 '22 03:04 BenTheElder

@BenTheElder

Any reason why something with Lunr couldn't be added statically to HUGO?

https://victoria.dev/blog/add-search-to-hugo-static-sites-with-lunr/

Browsing the docs is very painful currently. Even something rough like a Lunr Search page linked through the Table of Contents would be miles better to make the documentation more digestible.

lucasgcbkhomp avatar Sep 14 '22 19:09 lucasgcbkhomp

PRs are welcome!

sftim avatar Sep 14 '22 21:09 sftim