Skip to content

Filter by multiple tags#412

Merged
dergigi merged 5 commits into
OpenSats:masterfrom
moteanup24:filter-by-multiple-tags
Feb 27, 2025
Merged

Filter by multiple tags#412
dergigi merged 5 commits into
OpenSats:masterfrom
moteanup24:filter-by-multiple-tags

Conversation

@moteanup24
Copy link
Copy Markdown
Contributor

@dergigi I've created paths such as /tags/tag1/tag2 like so:

Screenshot at 2025-02-25 22-50-59

(/tags/opensats/funding is the only working route right now as a test case)

I've set it up such that users can select up to two tags by successively clicking on the tags they want to filter on. After selecting two tags, a third tag selection resets the previously selected tags.

Still working to flesh out the routes subject to any comments!

@vercel
Copy link
Copy Markdown

vercel Bot commented Feb 26, 2025

@moteanup24 is attempting to deploy a commit to the OpenSats Team on Vercel.

A member of the Team first needs to authorize it.

@dergigi
Copy link
Copy Markdown
Member

dergigi commented Feb 26, 2025

Awesome! I'll do my best to have a look later today.

@vercel
Copy link
Copy Markdown

vercel Bot commented Feb 26, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
os-website ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 27, 2025 5:04pm

@dergigi
Copy link
Copy Markdown
Member

dergigi commented Feb 26, 2025

I've set it up such that users can select up to two tags by successively clicking on the tags they want to filter on.

I don't think that's necessary to be honest. We'll mostly use these paths to deep-link into stuff from blog posts. There's no need for a user-facing UI imho.

@dergigi
Copy link
Copy Markdown
Member

dergigi commented Feb 26, 2025

Two levels deep (two tags) should be good enough for now. You should be able to do all permutations on the fly using the existing tags.

@moteanup24
Copy link
Copy Markdown
Contributor Author

@dergigi I think I got all the routes two levels deep. Note that I've explicitly excluded paths where the same tag is repeated.

Noted on the UI issue. I haven't removed any functionality but let me know if you'd like me to.

@dergigi
Copy link
Copy Markdown
Member

dergigi commented Feb 27, 2025

I think I got all the routes two levels deep

Excellent! Looks good & works well, so that's fantastic.

I haven't removed any functionality but let me know if you'd like me to.

Yes, please remove it. The behaviour is quite weird otherwise. As a user, I'd expect that a click on a tag will always filter by that tag. But now some weird magic is happening that isn't easy to understand, no matter if it's indicated by "Tags: x, y" or not.

Again, the main goal of this is that the routes work and we can deep-link to more specific lists of blog posts, which we wanted to do many times over but never could (for example: /lts/nostr & /lts/bitcoin & /lts/core, but also /donations/operations and stuff like that).

@moteanup24 moteanup24 force-pushed the filter-by-multiple-tags branch from 7e18d98 to 9c9b3ba Compare February 27, 2025 15:01
@moteanup24
Copy link
Copy Markdown
Contributor Author

OK! done :)

Copy link
Copy Markdown
Member

@dergigi dergigi left a comment

Choose a reason for hiding this comment

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

Looks good to me!

Let's ship it :shipit:

@dergigi dergigi merged commit e1ca776 into OpenSats:master Feb 27, 2025
@dergigi dergigi linked an issue Mar 4, 2025 that may be closed by this pull request
BoltTouring pushed a commit that referenced this pull request Mar 28, 2025
* restucture /tags directory; create dynamic routes for /tags/tag/tag2

* filter posts for up to two tags; prettify

* clean up comments, rename variables e.g. x/y to path

* add all combinations of tag1/tag2 routes

* remove dual tag UI functionality
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

Successfully merging this pull request may close these issues.

Allow for filtering by multiple tags

2 participants