-
Notifications
You must be signed in to change notification settings - Fork 18k
x/pkgsite: ?tab=doc is added automatically #37351
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
/cc @julieqiu |
The The Gophers Slack is an example of where people are posting |
I tried pkg.go.dev for a few days. I found that I was used to editing the address bar directly to switch between packages. So this automatically added The /cc @julieqiu one more time. 🍉 |
@aofei please don't /cc someone again if they're already on the issue (especially one that's only a week old). We take great care to look into every issue we receive and it all takes time to triage and respond. Thanks. |
We're currently discussing this request with our UX team, along with other design feedback we've received for the site. We want to review design feedback we have received as part of a broader redesign, as opposed to make piecemeal decisions. I'll update this issue once we have decided on any changes. /cc @fflewddur |
I just noticed that if a package contains no documentation but subdirectories, it loads the that tab without changing the URL btw; for example: https://pkg.go.dev/text/ Not sure if this is an oversight or intentional? |
I second all of the comments here on principally aesthetic grounds, but would also add that the Doc, Overview, Subdirectories, etc. of a module are clearly hierarchical resources of the path and as such shouldn't be specified as a query parameter. |
@peterbourgon I don't agree that they are clearly hierarchical in the scope of this URL. Additionally, what would happen if a module included a |
GitHub, for example, reserves the first layer of the path after the repo identifier for its tokens. If you want to access the subdir e.g. |
@peterbourgon GitHub can do that because they control the structure of repos: it's always github.com/{{user}}/{{repo}}. For modules, that is not the case. There is no way by looking at a path to know whether you are at the root of a module. GitHub also sacrifices the ability to link into the repo without specifying a query of We're open to suggestions, and believe me we have done the effort you suggested of considering patterns on other sites. This is the best we have come up with so far. If you have a reasonable suggestion that accounts for these constraints, we'd love to consider it. |
By the path alone, no, but pkg.go.dev has enough additional information to know if a path represents the root of a module.
I think I'd be OK with pkg.go.dev having a similar restriction and URL structure. For example:
Possibilities are many. To be clear, what I'm after here are clean URLs. I'm happy with any approach that gets me there :) edit: if it would be useful, I could make a stab at defining complete clean URL structure for current pkg.go.dev resources — would that be worthwhile, or just annoying? |
I would argue that the point of having a clean URL is that it is user predictable, not just predictable because we have a database of modules to query, or possibly fetch at runtime. The value is lost, to me, if a user has to think about it. Our current query parameter may not be aesthetically pleasing to everyone, but it is very predictable to omit and be redirected to.
We want the same thing (clean, predictable URLs)! I appreciate the thought you're putting into this. I have a couple other examples to throw in the mix:
I think it is worthwhile, but again, the most important thing to me is user predictability, not just a hierarchy that we can enforce in software. Funny story from this weekend that's very relevant to you: I was mentioning github.com/go-kit/kit/log to someone in Slack, which turned it into a link. Even though that is the most precise way to refer to that package in Go, it is a 404 due to GitHub's URL structure. I like that this works in our current design on pkg.go.dev, and would love for our URL design to be compatible with Go's import paths. |
I'll give it a shot, including your examples, and we'll see if something emerges 👍
I would argue that this "working" on pkg.go.dev is actually a bug, or at least not desirable. Go modules' SIV dictates that the un-versioned |
As much as I dislike (I do think |
+1 — I just think it should 301 to the explicit version the path resolves to, if that would enable better clean URLs. |
@peterbourgon Issue #38429 may be related. |
As I mentioned in #40550, editing the address bar is much more painful to do a simple operation like go to a subpackage. I think it's important to drop the |
Change https://golang.org/cl/254745 mentions this issue: |
Thanks for all the feedback, everyone. We're going to drop the Moving forward, requests to |
I've been using pkg.go.dev pretty much exclusively for the last few weeks for both stdlib packages and external ones; overall, it works well without major problems 👍
There is one small annoyance I've noticed though: it automatically adds
?tab=doc
The way I generally use this is by typing
pkg
in my browser's URL bar; this autofills tohttps://pkg.go.dev/
and I can now type or paste the package name; great!But the automatic adding of
?tab=doc
means that typing, say,net
means it'll be autofilled tohttps://pkg.go.dev/net?tab=doc
. I need to remove the query string to go to, say,net/http
, instead of just being able to typehttp
.I understand why this query string was added, and it's a minor annoyance, but for me at least, the experience would be improved by treating the lack of a query string as if
?tab=doc
was added, instead of doing a 302 redirect to the?tab=doc
variant.The text was updated successfully, but these errors were encountered: