daveaglick / discoverdotnet

A web site that helps you discover awesome .NET open source and community resources
https://discoverdot.net
MIT License
303 stars 255 forks source link

Add Filters/Sort to URL when changing them #37

Open nemec opened 6 years ago

nemec commented 6 years ago

Update the URL to include any filters or sorts applied when browsing projects. It would be nice to be able to link someone directly to, for example, the CLI tag if you need a new library for a CLI parser.

e.g.

https://discoverdot.net/projects/?tags=CLI,PDF
daveaglick commented 6 years ago

This is actually supported now, it's just not documented anywhere and the URL doesn't update on the fly. You can use the query string filter-filtername to turn on a filter and pass it comma separated values if it's a filter with multiple options like tags. I.e., https://discoverdot.net/projects/?filter-tags=compiler. One thing to note is that the filter-filtername is all lower case and without spaces or special characters whereas the filter values are as-in - I.e., https://discoverdot.net/projects/?filter-netfoundation and https://discoverdot.net/projects/?filter-tags=Data%20Access

nemec commented 6 years ago

You know, as I was writing this I thought to myself "I'll bet it's already done and I'll look like a fool when my sample link actually works as expected." I was just a little off, so only a slight fool :)

daveaglick commented 6 years ago

Going to leave this open as an enhancement to update the URL when changing sort/filter from the UI.