-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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
go.dev: support package owner-initiated redirect from godoc.org to pkg.go.dev #37099
Comments
Should the decision on which website to use be with the reader of the documentation, not the package author? Suggestion for making it the reader's choice: Add button to godoc.org banner that drops an "automatic redirect" cookie. Automatically redirect in presence of cookie. For godoc.org home page, show UI to undo auto redirect instead of redirecting. Edit: The proposal in this comment is for transition phase only. I think you will get better feedback from people who opt into testing pkg.go.dev than people who are forced into it by the package author. |
Change https://golang.org/cl/218697 mentions this issue: |
Updates golang/go#37099 Change-Id: Ibaf46b9182d761d56d8dc6770259ab4bc3703d59 Reviewed-on: https://go-review.googlesource.com/c/gddo/+/218697 Reviewed-by: Andrew Bonventre <andybons@golang.org>
Thanks for the suggestion, @stephenandwood! You can now redirect your own requests from godoc.org to pkg.go.dev, by visiting godoc.org?redirect=on. This will set a cookie in your browser, so that any request you make to godoc.org will be redirected to pkg.go.dev. If you want to turn this feature off, you can do so by visiting godoc.org?redirect=off. Thanks to @jamalc for this contribution! |
Change https://golang.org/cl/222315 mentions this issue: |
This change adds UI for the option to set a cookie and have candidate godoc.org links redirect to their equivalent pkg.go.dev counterparts. If a user returns to godoc.org with the utm_source form value equal to 'backtogodoc', it will display an option to turn off the automatic redirect. The intention is to have a link on pkg.go.dev that allows the user to return to godoc.org and also turn off the automatic redirect without having to know the special URL param values. Updates golang/go#37099 Change-Id: I27bd03cbc484a1e504795ff669224c2a2a7d72b6 Reviewed-on: https://go-review.googlesource.com/c/gddo/+/222315 Reviewed-by: Jonathan Amsterdam <jba@google.com> Reviewed-by: Alexander Rakoczy <alex@golang.org>
Change https://golang.org/cl/224659 mentions this issue: |
This will reliably indicate to pkg.go.dev that a request is due to the automatic redirect logic. Additional logic is added for more accurate mapping of godoc.org -> pkg.go.dev URLs. Updates golang/go#37099 Change-Id: Iba380a3b5951d50576c17711990d0ba87857b926 Reviewed-on: https://go-review.googlesource.com/c/gddo/+/224659 Reviewed-by: Julie Qiu <julie@golang.org>
Users can now opt-in to using pkg.go.dev by clicking "Always use pkg.go.dev" on the top of any godoc.org page. We are not planning to support redirecting traffic from godoc.org to pkg.go.dev at the package owner's request. Closing this issue. |
What is the URL of the page with the issue?
https://godoc.org/github.com/govim/govim
What is your user agent?
Screenshot
What did you do?
Ended up on https://godoc.org/github.com/govim/govim (through a Google search)
What did you expect to see?
What would I like to have seen? To have been automatically redirected to https://pkg.go.dev/github.com/govim/govim?tab=doc
What did you see instead?
The notice shown in the screenshot above, telling me about pkg.go.dev
This issue is really a suggestion that we add a mechanism to redirect traffic from godoc.org to pkg.go.dev at a package owner's request. For example, a special tag in the source VCS, e.g.
redirect_to_pkg.go.dev
, could signal to godoc.org that packages within that repository should be redirected. Taking GitHub as an example, such tags can be created/removed from the UI, making this a simple task with no commits required (which is useful if a project has gone into maintenance mode). On the godoc side, I suspect the required changes would be minimal (citation required) because godoc already has the necessary logic for refreshing from VCS.This would allow:
Clearly this redirect cannot be permanent, in case the package owner subsequently discovers a problem with the docs as visible on pkg.go.dev and needs to (temporarily) revert back to godoc.org.
This is, however, just a humble suggestion. My understanding of godoc.org (implementation) is very limited.
cc @julieqiu
The text was updated successfully, but these errors were encountered: