knowledge-hub icon indicating copy to clipboard operation
knowledge-hub copied to clipboard

[FEATURE] Resource Filter Settings in URL

Open VeckoTheGecko opened this issue 2 years ago • 3 comments

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 avatar Nov 08 '23 03:11 VeckoTheGecko

https://stackoverflow.com/a/8486188

https://stackoverflow.com/a/901144

VeckoTheGecko avatar Nov 08 '23 06:11 VeckoTheGecko

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

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

VeckoTheGecko avatar Nov 08 '23 06:11 VeckoTheGecko

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

dmlb avatar Nov 09 '23 21:11 dmlb