r-universe-org / help

Support and bug tracker for R-universe
https://docs.r-universe.dev/
8 stars 2 forks source link

Overhaul permanent URLs schema #216

Closed jeroen closed 1 year ago

jeroen commented 1 year ago

The permanent url should directly be short and only consist of the user and package name, similar to e.g. github.io.

https://ropensci.r-universe.dev/magick

This way we can easily link to a package page, and also subsections within the page, as in https://github.com/r-universe-org/help/issues/178.

https://ropensci.r-universe.dev/magick#readme
https://ropensci.r-universe.dev/magick#contributors

However this means that for different dashboard sections of the universe as a whole, we cannot use the url path anymore (as these now identify a package). We can do the same as github.com and use a ?tab= query like https://github.com/jeroen?tab=repositories

https://ropensci.r-universe.dev/?tab=builds
https://ropensci.r-universe.dev/?tab=packages

Another potential problem is that certain paths are reserved for cranlike server or API:

https://ropensci.r-universe.dev/src
https://ropensci.r-universe.dev/bin
https://ropensci.r-universe.dev/packages
https://ropensci.r-universe.dev/bages
https://ropensci.r-universe.dev/articles
https://ropensci.r-universe.dev/docs
https://ropensci.r-universe.dev/citation
https://ropensci.r-universe.dev/manual
https://ropensci.r-universe.dev/readme
https://ropensci.r-universe.dev/stats
https://ropensci.r-universe.dev/ui

But I think this is OK, we just can't support packages named src or bin or packages which is probably fine, but we should check this cannot be abused in some way.

Perhaps we can keep:

https://ropensci.r-universe.dev/src
https://ropensci.r-universe.dev/bin
https://ropensci.r-universe.dev/packages
https://ropensci.r-universe.dev/stream (instead of stats)
https://ropensci.r-universe.dev/ui (host js/css files and legacy)

And move others under the package name:

https://ropensci.r-universe.dev/magick/ (html homepage)
https://ropensci.r-universe.dev/magick/DESCRIPTION{,.json}
https://ropensci.r-universe.dev/magick/files.json
https://ropensci.r-universe.dev/magick/badge
https://ropensci.r-universe.dev/magick/NEWS{,.txt}
https://ropensci.r-universe.dev/magick/cite{,.json,html,txt}
https://ropensci.r-universe.dev/magick/doc/ (includes articles, readme, manual, news, citation)

nb: R manuals link to ../doc/ for articles so best is if bost are under package/doc/.

Overal a pretty complex change, but it will give much better permanent URLs. Also it will make it easier to replace the front-end with a new one in the future.

jeroen commented 1 year ago

One challenge here is case-sensitivity of package names. The usernames in r-universe are always normalized to lowercase (e.g. rOpenSci becomes ropensci.r-universe.dev) maybe we have to do the same for package names.

However R uses case sensitive package, names, so Rcpp is not the same as rcpp.

jeroen commented 1 year ago

This is now deployed!