hostthedocs icon indicating copy to clipboard operation
hostthedocs copied to clipboard

Decouple the Project Name from the Project URL (add a "url_name" parameter)

Open dougthor42 opened this issue 7 years ago • 2 comments

There should be a "url_name" parameter or something like that.

When uploading docs where name has a space in it, you end up getting urls that have %20:

curl -X POST -F [email protected] -F name="Some Name" -F version="0.0.1" -F description="Some Description" http://my_htd_instance/hmfd
# --> http://my_htd_instance/static/docfiles/Some%20Name/0.0.1/index.html

Personally I find this a bit ugly.

If there were another parameter that we could optionally send, we could do nifty things like this:

curl -X POST -F [email protected] -F url_name="my_project" -F name="Some Name" -F version="0.0.1" -F description="Some Description" http://my_htd_instance/hmfd
# --> http://my_htd_instance/static/docfiles/my_project/0.0.1/index.html

This would allow users to decouple the project name, what's seen here: image from the project url.

If the url_name parameter is not given, it just defaults to the name parameter, thus not changing the current functionality

Though personally I'd like to see name get URL-ized by going all lowercase and replacing space with underscore or dash, but that's a bit more breaking than what I'm proposing here.

dougthor42 avatar Jan 25 '17 22:01 dougthor42

That's a cool idea, would you want to submit a PR for it?

rgalanakis avatar Apr 20 '17 05:04 rgalanakis

It's on my list of things to look into, but I doubt I'll be able to get around to it any time soon 😢

dougthor42 avatar May 01 '17 22:05 dougthor42