The current search feature at packages.gentoo.org is implemented with Javascript in a way that users with plain old text console-based browsers (e.g., links) cannot use. When I go to the page in `links` ("-no-g" text-only mode -- and probably in graphics mode as well, but I don't use that), I don't see the search box, or any indication of a search feature anywhere on the page (only option then is to use the "categories" link to browse the tree, which is quite inconvenient). Same thing in a "regular" browser, like FF, when Javascript is turned off. This imposes an unnecessary burden on users with no Javascript capability, whether by choice or not (one group we should consider is users in the process of building a Gentoo installation who only have a text-console-based browser to use). Google-backend search boxes are trivial to implement in regular HTML (the output won't be as "pretty", but at least it's functional), and there's a standard HTML mechanism for providing "fallback" code when browsers don't have Javascript capabilities (<noscript> element). So can someone add a non-Javascript search alternative to packages.gentoo.org? Reproducible: Always Steps to Reproduce: 1. Go to packages.gentoo.org in a browser with no Javascript capability. 2. Try to search for something. 3. Be disappointed. Actual Results: No search box. No way to search beyond just browsing the entire Portage tree (if you can even figure out that the "categories" link lets you do that). Expected Results: A search box to accept your query and return useful results.
patches welcome.
I have no idea how to submit a patch for a website, but looking at how the current search feature is implemented, it seems that the fix can be as simple as replacing this line (number 43 in the HTML source of the homepage): <div id="cse" style="width: 100%;">Loading</div> by this: <div id="cse" style="width: 100%;"> <form class="search" method="GET" action="http://www.google.com/search"> <input type="text" name="as_q" value="" size="16" maxlength="127"> <input type="hidden" name="hl" value="en"> <input type="hidden" name="as_sitesearch" value="packages.gentoo.org"> <input type="submit" value="Search"> </form> </div> (No <noscript> needed. Javascript-enabled browsers will replace the GET search box by the fancy Javascript one, just like they replace the word "Loading" now.) This can be made more or even less complicated, as desired. (In particular, the size= and maxlength= attributes and the "hl" parameter aren't strictly necessary, and there may be other parameters I don't know about that, for example, make Google return search results with secure links to https://packages.gentoo.org/ -- the code above only returns normal http:// links, even when action="https://www.google.com/search" is used.) BTW, if you're making a mockup of this to look at (not changing the actual website itself), you might also want to: s/="\/media/="http:\/\/packages.gentoo.org\/media/ to the HTML source, so the stylesheet and site logo will be loaded. I coulda sworn something like this used to be on the site before the current Javascript-based search. If so, then maybe just put the old search-box HTML code in the "cse" div in place of what I have above.
bump... Come on, it shouldn't take more than 4 months to make this trivial change.
Coming up on a full year. Unbelievable...
Created attachment 409292 [details, diff] Patch to packages.git according to Donald's comments
Thank you for your patch. With the upcoming site relaunch that is based on new code, we no longer rely on Google to do package searching. As such, this issue is obsolete.