go.dev: support package owner-initiated redirect from godoc.org to pkg.go.dev

Created on 7 Feb 2020  路  7Comments  路  Source: golang/go

What is the URL of the page with the issue?

https://godoc.org/github.com/govim/govim

What is your user agent?

Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.66 Safari/537.36

Screenshot

Screen Shot 2020-02-07 at 06 55 04

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:

  • allow a partial and package owner-driven redirect of traffic, controlled by the package owner
  • help reduce the load on godoc.org and likely exercise pkg.go.dev more
  • remove the need for users to install a client side (browser) redirect from godoc.org to pkg.go.dev (which is potentially too blunt a tool in any case, if there are problems preventing some docs from being viewed on pkg.go.dev for example)

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

NeedsInvestigation pkgsite

Most helpful comment

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!

All 7 comments

Thanks for the suggestion, Paul! We've been discussing adding a redirect option, and are still working on figuring out the right UX flow for people to opt-in and opt-out.

/cc @andybons @spf13

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: gddo: add option to redirect requests to pkg.go.dev

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: gddo-server: add UI to turn on/off redirect to pkg.go.dev

Change https://golang.org/cl/224659 mentions this issue: gddo-server: add utm_source to pkg.go.dev redirect URLs

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

chai2010 picture chai2010  路  216Comments

derekmarcotte picture derekmarcotte  路  243Comments

miekg picture miekg  路  314Comments

jessfraz picture jessfraz  路  154Comments

adg picture adg  路  816Comments