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

search bar #310

Open
jpdeleon opened this issue Sep 16, 2022 · 9 comments
Open

search bar #310

jpdeleon opened this issue Sep 16, 2022 · 9 comments
Labels
enhancement New feature or functionality

Comments

@jpdeleon
Copy link

search bar

I plan to add hundreds of figures per gallery. Can you add a search bar to match filename responsively?

@jpdeleon jpdeleon added the enhancement New feature or functionality label Sep 16, 2022
@rprieto
Copy link
Member

rprieto commented Sep 16, 2022

Hi, this is an interesting idea. I have some questions:

  • What would it search on? Just the file name ? Photo caption / titles ? Or all metadata ?
  • What would the results look like ? A long list of matching photos, regardless of their location ? Or links to the corresponding albums ?

@rprieto
Copy link
Member

rprieto commented Sep 16, 2022

Potential technologies:

@jpdeleon
Copy link
Author

For my use case with hundreds of images per folder, searching just to regex match the file name and then responsively display the thumbnails like this would do. I imagine searching including the metadata would require large indexes.

@rprieto
Copy link
Member

rprieto commented Sep 18, 2022

Thanks. I'll see if it's possible. Were you thinking one global search, or a search per album (on each page)?

So far I'm thinking Thumbsup could generate a JSON file with all files (name + caption), and the themes can implement client-side search any way they want.

@jpdeleon
Copy link
Author

How about putting a search bar within the directory for a local search, whereas putting another search bar in the gallery view (where you can see all folders) for global search? For my purpose, a local search is enough.

@jpdeleon
Copy link
Author

jpdeleon commented Sep 28, 2022

@rprieto I use thumbsup to render the output images of our research team's data analysis pipeline, as shown here. As you see, there are thousands of images per folder and thumbsup still is amazingly fast/seemless in rendering the images. thumbsup would be even more awesome once a search bar is added to simply filter the filenames within the folder.

@rprieto
Copy link
Member

rprieto commented Sep 28, 2022

That's a great use case. I agree a search bar would be a good feature.

It will require a few changes, so I can't say exactly when it will be added (there's other changes in progress).

In the meantime here's 2 ideas:

  • For now you could copy one of the default themes, and add the search in JavaScript. You will need to could go through each image tag and extract the filename, and then call one of the libraries above to index the data.
  • I see there are a lot of images on that page! Have you considered --album-page-size to improve the page load time? Or using sub folders? Unfortunately, that's incompatible with my first suggestion, since it would only search on the current HTML page.

@jpdeleon
Copy link
Author

jpdeleon commented Sep 28, 2022

I don't know much about javascript but I am willing to try. From the docstring, --album-page-size limits the "Max number of files displayed on a page". Does it mean it will prune the total number of files viewable in the page, or just limit those files rendered at a time; i.e. scrolling will still show all files?

@rprieto
Copy link
Member

rprieto commented Sep 28, 2022

Hi, it will break down the album into multiple HTML pages, showing page numbers at the bottom to navigate between the pages. You can give it a try easily, as it doesn't affect the processed media, just the HTML pages. I'll update the documentation.

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

No branches or pull requests

2 participants