Bug
There are quite a few places where the strings “pkg.go.dev” and “beta.pkg.go.dev” are hardcoded into pkgsite.
When self-hosting, this causes a few bugs, especially where pkgsite redirects the user to https://pkg.go.dev instead of the current host.
Proposal
I suggest we add a Config.SiteName field that defaults to “https://pkg.go.dev” which should be overridden by a GO_DISCOVERY_SITE_NAME environment variable.
It would probably be useful in templates if a Config.SitePath(string) helper method could append an arbitrary path to the site name.
Links
Search: “pkg.go.dev” literal, excluding tests: pkg.go.dev repo:^github\.com/golang/pkgsite$ -file:\.md$ -file:_test\.go$ -file:^tests/ -file:testdata/
Related: #39827
Bug
There are quite a few places where the strings “pkg.go.dev” and “beta.pkg.go.dev” are hardcoded into pkgsite.
When self-hosting, this causes a few bugs, especially where pkgsite redirects the user to https://pkg.go.dev instead of the current host.
Proposal
I suggest we add a Config.SiteName field that defaults to “https://pkg.go.dev” which should be overridden by a GO_DISCOVERY_SITE_NAME environment variable.
It would probably be useful in templates if a Config.SitePath(string) helper method could append an arbitrary path to the site name.
Links
Search: “pkg.go.dev” literal, excluding tests:
pkg.go.dev repo:^github\.com/golang/pkgsite$ -file:\.md$ -file:_test\.go$ -file:^tests/ -file:testdata/Related: #39827