OSGeo / grass-website

Web site of GRASS GIS project (deployed from this repo twice a day)
https://grass.osgeo.org
GNU General Public License v3.0
17 stars 47 forks source link

Add search functionality to website #19

Closed neteler closed 2 years ago

neteler commented 4 years ago

It would be great to have website search (at time not implemented at https://staging.grass.osgeo.org/ while the old CMS offers it).

Apparently, there are different technologies available for that:

https://gohugo.io/tools/search/

veroandreo commented 4 years ago

The academic theme had a built-in search that might be useful too. It is then displayed as in: https://sourcethemes.com/academic/ (the magnifier glass in the upper right part :))

nbozon commented 4 years ago

Basic static "search engine" implemented and proposed in #131 Please test and reviw @neteler @lucadelu @veroandreo

veroandreo commented 3 years ago

Hugo-academic was renamed to wowchemy (MIT license). Here are the search functionalities provided:

Maybe we can just adapt one of them accordingly and re-use. I cannot really judge how difficult it might be.

The built-in one works nicely in my website. However (dunno if relevant for grass website), wowchemy docs say:

Note that this search engine runs entirely in the web browser on the visitor’s device. Thus, it is not scalable to an extremely large number of pages. If you have a very large amount of content and find the search running slowly, we recommend opting for a server-side search engine such as Algolia or Google

@nbozon, @lucadelu what do you think ?

lucadelu commented 3 years ago

@nbozon, @lucadelu what do you think ?

No clear idea, I looked at the code and this is only the client side there should be something more (like json document with all the info and some html code). Sorry but I have no time, now and probably in the next months, to spend on this topic

veroandreo commented 3 years ago

@nbozon, @lucadelu what do you think ?

No clear idea, I looked at the code and this is only the client side there should be something more (like json document with all the info and some html code).

This is what I found:

Sorry but I have no time, now and probably in the next months, to spend on this topic

No worries, I just wanted to understand which files were needed

ecodiv commented 3 years ago

This blogpost outlines some simple steps to get a client-side search page in a Hugo website: https://blog.wains.be/2020/2020-06-02-hugo-search-lunr/. It uses one of the options also mentioned in the link by Markus, hugo_lunr. Perhaps I am overlooking things, but this seems do-able?

nobeeakon commented 2 years ago

coming to this old discussion. In Hugo's website they discuss basically two approaches: client side and paid.

There is a third approach that is not really a search feature in the site itself, but that does the job. This is jus using some search engine (google, duckduckgo, etc) for the search and redirecting the user to the search engine.

As for the previous work that has been done. There are currently two old PRs, both using client side approach. #131 uses Vue (which may be a heavy library for this use case), and #242 which uses client side approach plus duckduckgo.

So, the options are:

From my point of view, if it's not an option to pay, I'd go with the search engine option.

@veroandreo

veroandreo commented 2 years ago

Thanks for your summary and analysis @nobeeakon :)

I'm fine with the option of using a search engine as @neteler proposed in #242. My reasoning and question here is: add a search engine to a website means the user wants to search something within the website content (first), otherwise they directly use google or duckduckgo... so, can that be somehow ensured? i.e., that the input search word is first searched for within the content of the website?

What do others think?

nobeeakon commented 2 years ago

@veroandreo , yep, for example in @neteler implementation, when searching spatio, you are redirected to Duckduck go, and get this (autommatically adds site:grass.osgeo.org so gives the info of the site you want to seach):

imagen