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 capability #89

Merged
merged 14 commits into from
Nov 16, 2024
Merged

Add search capability #89

merged 14 commits into from
Nov 16, 2024

Conversation

gmantele
Copy link
Member

@gmantele gmantele commented Oct 3, 2024

This PR aims to add an indexing capability using PageFile and then to add somewhere in the IVOA pages the search form and results.

Fixes #88

@gmantele gmantele added the new feature New feature or request label Oct 3, 2024
@gmantele gmantele self-assigned this Oct 3, 2024
@gmantele
Copy link
Member Author

gmantele commented Oct 3, 2024

Currently, PageFind is all configured. The Makefile has been adapted to index pages after their generation (PageFind indexes HTML files). This works well with the preview and the new html targets.

Left to do:

  • Adapt the CI to generate the search index (either using the Makefile or using directly the commands)
  • Add the search field
  • Add the search results

Questions to answer:

  • where should be the search field?
    • in the top navigation bar?
    • visible by default or a button should be clicked to show a search form (including the search field and eventually some filters)?
  • where should be displayed the search results?
    • in a contextual menu after having entered some letters?
    • in a dialog?
    • in a separate page?
  • do we want to filter the search results?
    • by date?
    • by section/direction? (e.g. newsletter, members, ...)
    • by tag? (then we should put some in our content pages)

Two examples of search capabilities with PageFind:

@gmantele
Copy link
Member Author

For the moment, the current prototype uses the CSS and JS of the same feature on the CDS website. They have been slightly adapted, but they should be completely adapted to the desired features and style of the IVOA website.

Anyway, the search capability is fully working here. You can already test it if you want, although it may be even more interesting while we will have the newsletters (which contain a lot of content).

Currently, the search capability is only available on a single dedicated page (/search/ ; a link is visible, temporarily at first position, in the top navigation bar). We have to decide where how we would like to trigger this search capability. A dedicated page like now or a modal dialog available on all pages when clicking on search button/icon?

@gmantele
Copy link
Member Author

I have not yet adapted the CI, so you will have to test this feature on your local repository ; it does not work yet on https://webtest.ivoa.info/v/iss88-search-index//search/ as PageFind is not installed and run.

To do that locally on your machine, you will have to:

  1. Checkout this branch
  2. Run make preview ; this will install PageFind, generate the search index and open the generated website in your web browser.

Only running the Hugo command is no more enough if you want to use the search capability.

@JeremyMcCormick
Copy link
Collaborator

JeremyMcCormick commented Oct 12, 2024

This looks great!

Is this ready to be merged? Or do you have more changes planned?

I'm starting to think the version sites are problemmatic to fully support. If this update would work on main, then I am okay merging it even if it doesn't function on the version/branch site.

@gmantele
Copy link
Member Author

As I said, it is not yet ready to be merged. I still have few style things to do, and tuning of the search engine.

And, we also have to decide

  • if this search feature is nice this way?
  • Do we want it as a dialog available on any page of the website (as on the CDS website)?
  • Is the link on the top left in the main nav bar is OK or should it be somewhere else?

@molinaro-m
Copy link
Member

I checked out and tried the solution on my laptop and it worked seamlessly (even before I realised it had finished).
We have to remember to discuss Grégory's questions in the comment above at our next vconf/meeting.

My preference: nice to have, dialog-wise, as a "lens" at the right end of the nav-bar.

@JeremyMcCormick JeremyMcCormick self-requested a review October 15, 2024 20:15
@JeremyMcCormick
Copy link
Collaborator

As I said, it is not yet ready to be merged.

My apologies, I see this is marked as draft.

@JeremyMcCormick
Copy link
Collaborator

JeremyMcCormick commented Oct 15, 2024

Questions to answer:

I have no problem to defer most of these questions until a later update in order to just get the search functionality enabled and working on the site first; I don't think we need to make all of those decisions now. From my perspective, you can do whatever you think is best for the initial implementation and then we can go from there. CDS website search functionality looks nice to me, personally, so I would have no issue if you just copied that for this PR.

My only preference is that we have a box that says "Search" in a prominent place, mainly for accessibility purposes.

for preview and page generation
The search feature already works. The current layout, styles and JS are a quickly adapted version of the CDS search feature.

The style should be adapted to the IVOA.

Questions left to answer:
- Are images necessary here?
- Do we need tags and dates being visible?
- Should this search feature be available as a modal on all pages?
…ically generated by Hugo should not be inspected.
@gmantele gmantele marked this pull request as ready for review November 12, 2024 14:04
@gmantele
Copy link
Member Author

Here is a first version of the search module in the IVOA website. It has room for improvement in future PullRequests in function of desired additional features:

  • search module as a popup
  • add a filter on the category of pages (e.g. newsletter or other)
  • change sort type and order (currently from the most recent to the oldest)
  • add a filter on eventual tags that could be added in the future (this feature is already in the code but just disabled)
  • ...

The CI has been updated in order to install PageFind (if not already installed or in the cache of GitHub) and to generate the index with PageFind. The preview version is now fully operational ; you can search on the search page.

@gmantele
Copy link
Member Author

I have also done two other unrelated things in this PullRequest:

  • upgrade Hugo (up to 0.135.0 ; not the latest, but a quite recent one ; further upgrade will be frequently done)
  • optimize all newsletters images in order to decrease the volume of data to deploy (from 137MB to 42MB), and then to speed up the deployment (from ~6min to 3min).

Now, I consider this PullRequest as ready for review and merge.

@gmantele gmantele requested review from JeremyMcCormick and molinaro-m and removed request for JeremyMcCormick and molinaro-m November 16, 2024 10:26
Copy link
Member

@molinaro-m molinaro-m left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated my branch locally and tested with the make preview.
Looks perfect to me.
Approved.

@JeremyMcCormick
Copy link
Collaborator

Absolutely fantastic @gmantele! :)

I tested as well using make preview and confirmed that the search is working, so I will merge.

@JeremyMcCormick JeremyMcCormick merged commit 02a2da8 into main Nov 16, 2024
1 check passed
@JeremyMcCormick JeremyMcCormick deleted the iss88-search-index branch November 16, 2024 11:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a Search Page feature
3 participants