Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add search via plain HTTP request #176

Open
serpent7776 opened this issue Jun 16, 2019 · 4 comments
Open

Add search via plain HTTP request #176

serpent7776 opened this issue Jun 16, 2019 · 4 comments

Comments

@serpent7776
Copy link

Currently there's only search via AJAX. It would be nice to query packages via GET under e.g. https://opam.ocaml.org/search/?q=foo to search for foo package. This will also help fix #153.

@ghost
Copy link

ghost commented Nov 17, 2020

I don't believe this is currently technically feasible from the website, given its focus on static generation.

I assume opam has a server itself for serving packages. Might be better to move this issue to the codebase tracking features for that server

@serpent7776
Copy link
Author

Should I open a new issue in some other repo? Where would that be?

@dra27
Copy link
Member

dra27 commented Nov 21, 2020

It’s fine here, it’s just not terribly likely to happen.

The search isn’t currently done using AJAX, it’s simply done on the client. opam2web is designed to generate a static site, so if your intention was to be able to have this without JavaScript, that’s pretty much never going to happen.

That said, it would be possible to have the page read the query string and do the filtering (and a contribution to do that would be fine)

Please note (from an open source perspective) that “it would be nice if” is not the most compelling reason for others to pick the issue up - “I can’t do x because opam2web doesn’t recognise query strings” is more convincing 🙂

@serpent7776
Copy link
Author

My intention was to be able to use it with search shortcuts in the browser, so that I can type e.g. opam foo in address bar and opam site will be opened with the foo query used to filter entries. This requires a GET parameter to be present.
I guess that reading the query on page load would be enough for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants