numpy / numpy.org

The NumPy home page
http://numpy.org/
BSD 3-Clause "New" or "Revised" License
109 stars 105 forks source link

Search box needed #263

Open bjnath opened 4 years ago

bjnath commented 4 years ago

I don't see a search box on the site, and I didn't find search mentioned in the issues. Is that correct? Is one in the works?

Users expect a search box on every site, but especially on a site that exists to be informative.

I imagine there are technical challenges because of the split content. We somehow need to solve them.

Imagine the response if we go live without a search box. "They put up this fancy new site and forgot / took away the search box."

rgommers commented 4 years ago

Good point, we don't have one but do need one. So much to think about when building a nice website ....

There's some options to implement one at https://gohugo.io/tools/search/

bjnath commented 4 years ago

But Hugo search isn't adequate.

Users will put NumPy questions in the search box and expect the same answers they do now. Users don't know there's a different site under the cover.

Search results must come from Hugo and Sphinx, and if either of them is expendable it's Hugo.

joelachance commented 4 years ago

But Hugo search isn't adequate.

Sure it is! It searches the site.

Users will put NumPy questions in the search box and expect the same answers they do now. Users don't know there's a different site under the cover.

Probably true, but we don't know this. I don't think we can expect adding search to be the same as using StackOverflow.

Is this something we want to add before launch? Because if it is, I'd push to start small, and add as we go. I agree search for both the site & docs would be great, I'm not sure it's doable by the time we want to launch, which I was understanding was very soon.

bjnath commented 4 years ago

It searches the site.

There are two sites, with HTML in different places.

joelachance commented 4 years ago

@bjnath Yep, of course. But it will be a good amount of work to search both sites. Starting small is in our best interest.

bjnath commented 4 years ago

starting small

"Starting small" would mean passing through Sphinx search and ignoring Hugo for now.

We can't give users a search box that's broken for the kinds of queries people expect the site to answer.

joelachance commented 4 years ago

@bjnath I think that would be great, I'd welcome a PR if you want to tackle it!

bjnath commented 4 years ago

@joelachance Cool -- let me take a look.

bjnath commented 4 years ago

Low-stress solution: a hyperlink that looks like a search box:

image

The user has to click on the box to fill it out. Instead of going blank, it takes the user to https://numpy.org/devdocs/search.html, our real search page:

image

Less annoying than you'd think, when I tried it out.

It's not perfect, but it solves the users' problem and ours.

Gist: https://gist.github.com/bjnath/d1830c3434413ecfeaca3bc36fb99d3d

rgommers commented 4 years ago

That'd be a good stopgap solution (with some styling). Where would we put it - right side of the navbar?

rgommers commented 4 years ago

https://pytorch.org/ has a styled looking glass in the right top corner that's quite nice. With live incremental search. Not for now, just noting cause it's pretty cool.

bjnath commented 4 years ago

right side of the navbar?

That's what I'd envisioned. I'm open to any place you'd expect a search bar to be.

with some styling

Yes, please! That was strictly proof of concept.

stefanv commented 4 years ago

https://pytorch.org/ has a styled looking glass in the right top corner that's quite nice. With live incremental search. Not for now, just noting cause it's pretty cool.

That is pretty neat! And, this should be quite doable, since Sphinx has a JS library, and StackOverflow has an API.

Agreed that this can wait, but would be fun to build.

bjnath commented 4 years ago

I assume everyone has already clicked and found how painlessly they're doing it?

https://docsearch.algolia.com/

rgommers commented 4 years ago

I hadn't - looks pretty cool!

joelachance commented 4 years ago

@bjnath, nice find!