ClimateTown / knowledge-hub

Your one-stop shop in the fight against climate change, containing important climate resources you wish you knew about yesterday.
https://hub.climatetownproductions.com
Creative Commons Attribution 4.0 International
36 stars 26 forks source link

[FEATURE] Resource Filter Settings in URL #360

Open VeckoTheGecko opened 10 months ago

VeckoTheGecko commented 10 months ago

Describe your suggested improvement Load the URL filter settings from the URL, and vice versa. For example:

https://climatetown.github.io/knowledge-hub/resources?tags=knowledge-hubs,climate-journalism&mode=intersect will go to the resource page, select the "Knowledge Hubs" and "Climate Journalism" tags in intersect mode.

It would also be good to add a button to copy the URL for a filter setting to clipboard.

Also needs to ignore incorrect parameters in the URL.

Describe the benefit This would be really handy for users to share specific filter settings, and will allow a deeper integration of the Hub with the Discord server (e.g., pinning posts in various channels with specific filter settings).

Would you be capable/willing to implement the improvement? Yes, but also really keen to have other people on board on this (I have some other things to focus on too ;) ).

Additional comments None

VeckoTheGecko commented 10 months ago

https://stackoverflow.com/a/8486188

https://stackoverflow.com/a/901144

VeckoTheGecko commented 10 months ago

Huh, looks like this dependency does it all. No custom code :D

https://www.npmjs.com/package/query-string

dmlb commented 10 months ago

https://dev.to/mohamadharith/mutating-query-params-in-sveltekit-without-page-reloads-or-navigations-2i2b