Граф коммитов

208 Коммитов

Автор SHA1 Сообщение Дата
Russ Cox 40c959ae94 cmd/golangorg: take on serving of go.dev
This CL merges go.dev/cmd/frontend into cmd/golangorg,
now that they share the same serving framework (internal/web).

Change-Id: I367d5c79b993f25ce411544b00f6db6d820290e0
Reviewed-on: https://go-review.googlesource.com/c/website/+/339404
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
Website-Publish: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
2021-08-17 15:50:01 +00:00
Russ Cox 30177b287d cmd/golangorg: fix prod-only cmd/golangorg test failures
- error in dl.tmpl (turns up only with access to golang-org prod database)
- adjust expected 404 error to work both locally and in prod

Change-Id: I7e5f5bd188a02936a617a427add5b8a6fbb0b80a
Reviewed-on: https://go-review.googlesource.com/c/website/+/342897
Trust: Russ Cox <rsc@golang.org>
Website-Publish: Russ Cox <rsc@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-08-17 15:34:59 +00:00
Russ Cox ef7fed48ec internal/web: merge with go.dev/cmd/internal/site
internal/web was the framework left serving golang.org.
go.dev/cmd/internal/site was the framework serving go.dev.
This CL merges the two into a coherent, simple site serving
framework that works for both sites, a step toward merging
the sites themselves.

The CL is difficult to break up, so it's a bit larger than would be ideal.
The best place to start is the doc comment in internal/web/site.go
and then the other changes in that directory.
The rest of the CL is just minor adjustments to the repo to match.

Change-Id: I927dea29396104a817bd81b6bf25fa43f996968f
Reviewed-on: https://go-review.googlesource.com/c/website/+/339403
Trust: Russ Cox <rsc@golang.org>
Website-Publish: Russ Cox <rsc@golang.org>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
2021-08-17 13:59:37 +00:00
Russ Cox f5962bb4b5 cmd/golangorg: fix and clean up m.golang.org redirect
Use http.RedirectHandler (forgot that existed before).
And add to validHosts so that the general golang.org doesn't kick in.

Change-Id: I80e4cd3f2324889bbda0ea42c17f73695c061abe
Reviewed-on: https://go-review.googlesource.com/c/website/+/342889
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-08-17 13:59:17 +00:00
Russ Cox 574d4b889b cmd/golangorg: redirect beta to tip
To be submitted once tip is being served from this app.

Change-Id: Iadcbaf83978bf636babec9a634c09f9adf7691c1
Reviewed-on: https://go-review.googlesource.com/c/website/+/339398
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-08-17 12:49:07 +00:00
Russ Cox 28a7f879f1 cmd/golangorg: serve m.golang.org redirect
When we set up Gmail for golang.org a decade ago,
we also configured Gmail to serve m.golang.org as a shortcut
to redirect to the full Gmail URL for golang.org.
It still does, but only if you connect to http://m.golang.org/.

CL 122175 broke the m.golang.org redirect back in summer 2018
by setting an HSTS Strict-Transport-Security header with includeSubdomains,
so that visiting golang.org stops the browser from being willing to
visit http://m.golang.org/. It goes straight to https, which fails.

I have been annoyed for years that this was broken, but I wasn't sure
when it started and never took the time to track down what was wrong.

This CL fixes m.golang.org by serving the redirect ourselves.

Change-Id: I290bb2fe7fc7a415d00162776ecc54527e431c61
Reviewed-on: https://go-review.googlesource.com/c/website/+/341710
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Website-Publish: Russ Cox <rsc@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-08-13 19:21:23 +00:00
Russ Cox 42b41e29af cmd/golangorg: serve tip.golang.org directly from Gerrit
This CL enables the code, committed in an earlier CL,
that serves tip.golang.org from an in-memory copy of the
Go repo, updated by a background loop, which will let us
retire the more heavyweight "deploy a whole new app in a loop"
that we currently use for tip.golang.org.

When this CL is committed, the "deploy a whole new app in a loop"
logic will deploy this new code, which will then start using the
in-memory copy, even though it is also being updated on each
change. At that point it will be safe to take down the app-updating
loop entirely, letting the default app do the serving.

Change-Id: Ica5cffd684c45d4a5b059772700a0a608f832bad
Reviewed-on: https://go-review.googlesource.com/c/website/+/335049
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Website-Publish: Russ Cox <rsc@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-08-12 13:25:59 +00:00
Russ Cox f4281e3dec cmd/golangorg: add ability to serve tip.golang.org directly from Gerrit
Currently, tip.golang.org is deployed by a background loop
that fetches the latest Go and website repos every few minutes
and then does a deploy to a whole separate app.
Because this setup is different from the main app deploy,
it often gets broken by changes in the way the main app runs.

This CL removes the recurring source of breakage by making
the main app capable of serving tip.golang.org directly.
It does this by watching the main Go repo itself and downloading
a new copy of the file tree whenever there are changes.

The website repo is not watched: new changes to the website
repo already result in redeploys of the entire app when appropriate.

This CL does not actually enable the new tip.golang.org code.
A followup CL will do that, for easier rollback.

Change-Id: I015368c614579c90fa72a6699f6ab76202f87e7e
Reviewed-on: https://go-review.googlesource.com/c/website/+/328214
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-08-12 13:25:58 +00:00
Alexander Rakoczy 8bf2ffb05d blog, tour, go.dev, golang.org: stop referencing mirror.gcr.io URLs
As per the documentation: Google Cloud services such as Cloud Build and
Google Kubernetes Engine automatically check for cached images before
attempting to pull an image from Docker Hub.

Also: Only obtain cached images on mirror.gcr.io by configuring the
Docker daemon. A request to pull directly from mirror.gcr.io will fail
if a cached copy of the image does not exist.

Source: https://cloud.google.com/container-registry/docs/pulling-cached-images

Change-Id: I4320f97b016d928ea7431c56dd7486467f436a53
Reviewed-on: https://go-review.googlesource.com/c/website/+/340171
Trust: Alexander Rakoczy <alex@golang.org>
Run-TryBot: Alexander Rakoczy <alex@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Website-Publish: DO NOT USE <dmitshur@google.com>
2021-08-05 17:43:24 +00:00
Russ Cox 39c67f0653 internal/pkgdoc: take on doc-specific parts of internal/web
Not all the package docs-specific parts of the server moved into
internal/pkgdoc before. Finish the job. Now the API for pkgdoc
is like the API for codewalk: just a NewServer that returns a handler.

Speaking of codewalk, unexport the Server type to match the
trimmed-down pkgdoc.

Change-Id: I19ba7351d55fb5d23d551a0296bb89d8abac6e9b
Reviewed-on: https://go-review.googlesource.com/c/website/+/328212
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Website-Publish: Russ Cox <rsc@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-07-23 19:28:56 +00:00
Carson Hoffman 7b37f32c8b internal/web: stop double-escaping of code in non-playground examples
CL 317655 introduced an issue causing non-playground code examples
to be double-escaped, causing HTML escape sequences and elements
to appear in the code, such as the examples in crypto/rsa,
as reported in golang/go#46839. This change treats the code as
template.HTML rather than string after running through (*Page).Node
(which formats the code as HTML) and doing some basic transformations,
preventing this double-escaping from occurring.

Fixes golang/go#46839

Change-Id: Id226147eb51219bd5e2db61e959519258e39a298
GitHub-Last-Rev: 81f8dc5e87
GitHub-Pull-Request: golang/website#73
Reviewed-on: https://go-review.googlesource.com/c/website/+/332889
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Cherry Mui <cherryyz@google.com>
2021-07-19 21:36:17 +00:00
Russ Cox 29745a29f8 cmd/golangorg: fix, restore tip.golang.org tests
The golang.org health check was failing the tip.golang.org tests
because the host enforcer was redirecting an unknown subdomain
to golang.org. Make tip a known subdomain to fix the tests, and
then restore them.

(The standard tip.golang.org setup disables the enforcer instead.)

Change-Id: Id15e7bcb3a704b7782e132c4303576f9d3e80cb0
Reviewed-on: https://go-review.googlesource.com/c/website/+/334112
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
Website-Publish: Russ Cox <rsc@golang.org>
2021-07-12 20:02:05 +00:00
Russ Cox e8cce616b8 cmd/golangorg: fix test case for tip
The tip code hasn't landed yet, this snuck in early.

Change-Id: I6ca1dcd5cca403456dc8e13e5a2821b553619f50
Reviewed-on: https://go-review.googlesource.com/c/website/+/334110
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
2021-07-12 19:14:20 +00:00
Russ Cox aa5eb5fcb4 internal/web: redirect golang.org/pkg/... to pkg.go.dev/...
This reduces the number of documentation sites we have to one.
Except in China, where we have to keep serving on the one domain
golang.google.cn - there is no pkg.go.dev in China.
And unless people opt out with ?m=old.

For golang/go#44356.

Change-Id: I2a5b788ac861ce37f356287413468497d184fc09
Reviewed-on: https://go-review.googlesource.com/c/website/+/327849
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-07-12 19:03:25 +00:00
Russ Cox 5f5f230b60 all: promote new app deployments only after they become ready
There are differences in the App Engine environment that
cannot be adequately simulated elsewhere. Although we do
the best we can with testing locally, there will always be
differences.

The old makefiles deployed the site, then ran a regression
test against it, and then promoted the tested version.

This change does the same. The testing has moved into the
web server proper so that it can test the handler directly and
thereby check things like the responses on different domains.

The go-app-deploy.sh now always deploys --no-promote,
only promoting after a self-test passes on the deployed site.

Unlike the old check which only applied to golang.org,
the new pre-promotion testing happens for all the sites.

Also factor out GoogleCN into internal/web, because we needed
to modify it (to avoid internal/webtest's requests being diagnosed
as coming from China) and there were too many copies.

Change-Id: I0cde0e2167df2332939908e716ddb6bf429f2565
Reviewed-on: https://go-review.googlesource.com/c/website/+/329250
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-06-23 19:06:38 +00:00
Russ Cox d38c22d04f cmd/golangorg: expose multiple domains on testing servers
We already have one server handling multiple domains:
golang.org and golang.google.cn. As we make the server
handle more domains it is helpful to be able to get at each
of them in the testing server.

This CL changes the behavior on localhost or on an appspot.com domain
to pull the effective host name out of the first element of the path.
It also rewrites HTML responses to turn relative links like /doc to /<host>/doc
and to turn absolute links like https://golang.org/doc into /golang.org/doc.

Change-Id: I032b626f1c75deed61a9ae2d9562d6b177b2824a
Reviewed-on: https://go-review.googlesource.com/c/website/+/328013
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-06-23 18:38:55 +00:00
Russ Cox 06fdb770f7 cmd/golangorg: make zip contents seekable
https://golang.org/misc/cgo/stdio/testdata/fib.go fails right now
because the http.FileServer wants to use Seek to find out the file size.
Make that work by introducing an FS wrapper that enables seeking
in an in-memory copy of the file content.

Fixes golang/go#46809.

Change-Id: I353905310dc74594e54e0181dc821a97992b8da7
Reviewed-on: https://go-review.googlesource.com/c/website/+/329249
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Russ Cox <rsc@golang.org>
2021-06-18 01:31:37 +00:00
Russ Cox a2b5f4911c cmd/golangorg: find contentDir even on App Engine
After the refactoring we use this now instead of repoRoot
in the call to NewHandler.

Once we have Go 1.16 this will all be simplified using //go:embed.

Also delete comment that I deleted locally in the previous CL
but then didn't upload before clicking Submit on the Gerrit web page.

Change-Id: Id6e122d39914c1059e97af6cd7e90049142dbe7f
Reviewed-on: https://go-review.googlesource.com/c/website/+/329010
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-06-18 01:30:32 +00:00
Russ Cox 30658dff6b cmd/golangorg: factor out main handler setup
Also avoid use of http.DefaultServeMux entirely, for clarity about what is registered.

Change-Id: Ibd7ccd7a6c3cb6b79e94b77570ad016a1be11f0c
Reviewed-on: https://go-review.googlesource.com/c/website/+/328012
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Website-Publish: Russ Cox <rsc@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-06-17 16:55:37 +00:00
Russ Cox 7e9c28a76a cmd/golangorg: merge into single source file
There is so little left here that the file
boundaries make no sense anymore.
Move all the functions into main.go.
registerHandlers was inlined instead of
copied.

Change-Id: If91a5d1dc75834747b9d803ec44790950d503aed
Reviewed-on: https://go-review.googlesource.com/c/website/+/328011
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-06-17 16:18:35 +00:00
Russ Cox fdd9055814 cmd/golangorg: deduplicate testdata/live.txt and testdata/web.txt
These are duplicates for no particularly good reason anymore.
Move the general tests into testdata/web.txt, leaving in live.txt
only the tests that cannot work except in production.

Change-Id: Ia8b4271a9cce78814ac57c7b4a462383e77ee3d5
Reviewed-on: https://go-review.googlesource.com/c/website/+/328010
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-06-17 16:18:31 +00:00
Russ Cox 99fa69ef01 cmd/golangorg: remove global fsys, site
Also clean up hostEnforcerHandler doc comment while we are here.

Change-Id: I2db17d8146eaba95c887e1439320e30e9c8fc769
Reviewed-on: https://go-review.googlesource.com/c/website/+/328009
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-06-17 16:18:27 +00:00
Russ Cox 73dd377356 cmd/googlegolangorg: make google.golang.org a separate service
The version cleaner deleted the very old version of golang.org
named "google", as it was designed to do. Make google.golang.org
its own service instead of a precarious version.

Already deployed, to bring back google.golang.org.

Change-Id: Ia3e63a93d8b613e9cc7f7d241d9187d9422cf6ba
Reviewed-on: https://go-review.googlesource.com/c/website/+/328689
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-06-16 18:39:28 +00:00
Russ Cox e0d934b436 cmd/golangorg: simplify, run on App Engine Standard, not Flex
This app has been through a lot of evolution and has accumulated
a lot of cruft in the way it is deployed. We can simplify deployment
down to a short Cloud Build script and go back to regular App Engine
for execution.

Also remove the prod-vs-local distinction and the build tag complexity.

App Engine Flex doesn't let us have extant versions without at least
a couple dedicated VMs, and then it also imposes a limit of 20 VMs,
which makes it unsuitable for continuous deployment, where we can
rack up many versions in a short amount of time. Going back to
App Engine Standard is a better fit, since versions that aren't getting
traffic scale down to zero.

Using App Engine Standard also matches blog and go.dev,
which will help with the eventual merging of all these servers.

Change-Id: I35167b569327ad253b9d367d747072a269205b20
Reviewed-on: https://go-review.googlesource.com/c/website/+/323892
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-06-16 18:19:59 +00:00
Russ Cox d831351689 all: make compatible with Go 1.15
With the help of the backported libraries introduced in the previous CL,
we can make the whole cmd/golangorg site run on Go 1.15 again.
This will let us use App Engine standard in advance of the release
of Go 1.16 on App Engine.

Change-Id: I9d1612de6f366e0774919aa6a94af14aafb248f5
Reviewed-on: https://go-review.googlesource.com/c/website/+/323891
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-06-15 02:35:50 +00:00
Russ Cox fb64aa77f9 cmd/golangorg: change tests to use internal/webtest
Much shorter and clearer.
This also opens up the possibility of sharing
some tests between TestWeb and TestLiveServer.

Change-Id: Iaca004c88581b0e0d8c858333806f755cc140255
Reviewed-on: https://go-review.googlesource.com/c/website/+/321075
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Website-Publish: Russ Cox <rsc@golang.org>
2021-06-15 02:12:41 +00:00
Russ Cox de60b61b0e cmd/golangorg: split out internal/codewalk [generated]
This code is not likely to ever change, so it's nice to stash elsewhere.

CL generated by the script below.

[git-generate]
cd cmd/golangorg
rf '
	mv codewalk.go golang.org/x/website/internal/codewalk
'
cd ../../internal/codewalk
rf '
	mv CodewalkServer Server
	mv NewCodewalkServer NewServer
	mv Codewalk codewalk
	mv Codestep codestep
'

Change-Id: If16a7dc9214a8d44ce42bc8e7e6ccd502b718c0e
Reviewed-on: https://go-review.googlesource.com/c/website/+/317661
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
Website-Publish: Russ Cox <rsc@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-06-14 17:41:40 +00:00
Russ Cox 5d72b68448 cmd/golangorg: introduce CodewalkServer
Preparation for moving to a new package.

Change-Id: Ib246f694f950eadcb9afa78e6551c8fb22e109a8
Reviewed-on: https://go-review.googlesource.com/c/website/+/317660
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-06-14 17:41:39 +00:00
Russ Cox 5ee419f2ea all: remove toFS usage
The toFS calls were a stop-gap to convert from old code that wasn't
strict about path forms to the io/fs routines that are more strict.

Arrange to pass io/fs-compatible paths everywhere and remove toFS.

Change-Id: Id69c0f23074ebd3a6dfef2255b2f8185ad1d1249
Reviewed-on: https://go-review.googlesource.com/c/website/+/317659
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-06-14 17:41:38 +00:00
Russ Cox 4b5486d0e5 internal/dl: move template to lib/godoc
This completes an old TODO and uses the standard site frame
for the download page instead of having a separate copy.

Change-Id: Id647a6bb03d563b007b16cab51f40083d071c944
Reviewed-on: https://go-review.googlesource.com/c/website/+/317658
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-06-14 17:41:36 +00:00
Russ Cox b94de85b36 cmd/golangorg: fixup -tags prod for internal/web
prod.go is build-tagged away and not updated by rf.

Change-Id: I40a655586ff9e019cccdf82ca96b25c6b80e383d
Reviewed-on: https://go-review.googlesource.com/c/website/+/317657
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-06-14 17:41:35 +00:00
Russ Cox 117627b3c2 internal/godoc: refactor into internal/web [generated]
What's left of internal/godoc is mainly a simple web server
for static content (plus the package docs provided by internal/pkgdoc)
and bears little resemblance to the original godoc.

Revamp the API and retire the name, moving to internal/web.

CL generated by the script below.

[git-generate]
cd internal/godoc
mv util.go istext.go
mv godoc_test.go template_test.go
mv server_test.go site_test.go

rf '
	mv TabWidth tabWidth
	mv IsText isText
	mv TabSpacer tabSpacer

	mv Presentation Site
	mv NewPresentation NewSite
	mv writerCapturesErr writeErrorSaver
	rm marshalJSON
	mv redirect maybeRedirect
	mv redirectFile maybeRedirectFile
	mv Site.serveText Site.serveRawText
	mv Site.serveTextFile Site.serveText
	mv Site.serveDirectory Site.serveDir
	mv Site.initFuncMap Site.initDocFuncs

	mv \
		toFS \
		Site \
		NewSite \
		Site.ServeError \
		Site.ServeHTTP \
		Site.ServePage \
		Page \
		Site.fullPage \
		Page.Invoke \
		writeErrorSaver \
		writeErrorSaver.Write \
		applyTemplateToResponseWriter \
		Site.serveFile \
		maybeRedirect \
		maybeRedirectFile \
		doctype \
		Site.serveHTML \
		Site.serveDir \
		Site.serveText \
		selRx \
		rangeSelection \
		Site.serveRawText \
		Site.googleCN \
		site.go

	mv example_nameFunc example_name
	mv example_suffixFunc example_suffix
	mv srcPosLinkFunc srcPosLink

	mv \
		siteFuncs \
		example_name \
		example_suffix \
		srcToPkg \
		Page.SrcPkgLink \
		Page.SrcBreadcrumb \
		Page.SrcPosLink \
		srcPosLink \
		sitefuncs.go

	mv \
		docServer \
		docServer.ServeHTTP \
		Page.ModeQuery \
		pkgdoc.go

	mv metaJSON fileJSON
	mv extractMetadata parseFile
	mv \
		file \
		fileJSON \
		join \
		open \
		jsonStart \
		parseFile \
		file.go

	mv \
		Site.initDocFuncs \
		Site.code \
		Site.contents \
		stringFor \
		Site.oneLine \
		Site.multipleLines \
		parseArg \
		match \
		docfuncs.go

	mv Site.ServeError.p Site.ServeError.s
	mv Site.ServeHTTP.p Site.ServeHTTP.s
	mv Site.ServePage.p Site.ServePage.s
	mv Site.code.p Site.code.s
	mv Site.contents.p Site.contents.s
	mv Site.fullPage.p Site.fullPage.s
	mv Site.googleCN.p Site.googleCN.s
	mv Site.initDocFuncs.p Site.initDocFuncs.s
	mv Site.multipleLines.p Site.multipleLines.s
	mv Site.oneLine.p Site.oneLine.s
	mv Site.serveDir.p Site.serveDir.s
	mv Site.serveFile.p Site.serveFile.s
	mv Site.serveHTML.p Site.serveHTML.s
	mv Site.serveRawText.p Site.serveRawText.s
	mv Site.serveText.p Site.serveText.s
	mv Site.writeNode.p Site.writeNode.s

	mv Page.pres Page.site

	mv astfuncs.go docfuncs.go examplefuncs.go \
		file.go istext.go markdown.go pkgdoc.go \
		site.go site_test.go sitefuncs.go \
		tab.go template_test.go \
		golang.org/x/website/internal/web
'
rm godoc.go meta.go page.go pres.go server.go template.go

cd ../../cmd/golangorg
rf '
	mv pres site
'

Change-Id: Ic03a2dbe14f74c60bd6a5a86ba4d3f36d8c5bea8
Reviewed-on: https://go-review.googlesource.com/c/website/+/317656
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-06-14 17:41:29 +00:00
Russ Cox 4c9e549253 internal/godoc: clean up use of templates
- convert from text/template to html/template
- use proper template set
- always pass *godoc.Page to templates, with custom value in .Data
- move stateful site template functions to methods on *godoc.Page
- unexport Presentation.ServeFile: ServeHTTP is good enough
- reorder api.DB.Func args to match source order (pkg first)
- rename lib/godoc/godoc.html to lib/godoc/site.html
  (lib/godoc itself must stay lib/godoc because of links to other content it holds).

Change-Id: I873f17db20107fdab11d276932e6d847a6081015
Reviewed-on: https://go-review.googlesource.com/c/website/+/317655
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-06-14 17:41:27 +00:00
Russ Cox 72dd19b3a4 cmd/golangorg: remove various special-case handlers
Redirects can be handled by internal/redirect.
Raw-text serving is already handled in internal/godoc.
It can handle robots.txt and /doc/play/ too and avoid
exposing the underlying FileServer.

Change-Id: I11dda651128815b17cbd3a5db6572f21067529a7
Reviewed-on: https://go-review.googlesource.com/c/website/+/317653
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-06-08 20:19:34 +00:00
Russ Cox 065e1c71e5 internal/godoc: take over HTML template loading
Move template loading from cmd/golangorg to internal/godoc,
which needs them.

Change-Id: I97cfebaa7e4bd3aa3bcc88e05a05393c1e8bbd1f
Reviewed-on: https://go-review.googlesource.com/c/website/+/317652
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-06-08 20:19:17 +00:00
Dmitri Shuralyov 64052e727d cmd/golangorg: update TestLiveServer for path and and date changes
CL 296383 removed a trailing slash and .html suffix from some URLs.
CL 296429 changed the date format from yyyy/mm/dd to yyyy-mm-dd.

Update TestLiveServer accordingly so it passes on an instance that
would be deployed.

Change-Id: I6a632c8db1a6bc335946a7f6b131c6af60021b94
Reviewed-on: https://go-review.googlesource.com/c/website/+/322971
Trust: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
2021-06-01 15:04:05 +00:00
Russ Cox 1a32f50734 internal/godoc: delete Corpus
There's nothing left in Corpus but the file system and the API database.
Hoist them into Presentation and delete the Corpus itself.

Change-Id: I2cb61b77122b2f7216b0b2a96fd6b48e29eae189
Reviewed-on: https://go-review.googlesource.com/c/website/+/317651
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-06-01 14:44:26 +00:00
Russ Cox d8909ee5a6 all: remove Path metadata-based redirects
Back when the entire site had to live in $GOROOT/doc, we needed
some way to specify content that was served from URLs outside of golang.org/doc,
so we added the ability for a doc to declare its own URL (the Path metadata).
That meant the file system layout did not match the URL layout.
That meant the content for any particular URL could be anywhere in the file system.
That meant the entire file system had to be scanned to serve a URL.
That meant an index of the file system had to be built and updated.

Now that we have a file tree (_content) for the whole of golang.org,
we can move files to make the file system layout match the URL space.
Then each URL can be served by just reading the right file.
Then the index and its updater can be deleted.

And now if you want to edit /doc/gdb it's obvious which file to open.

Change-Id: I3357f275e61a31c8de3091af580cac80753e71a4
Reviewed-on: https://go-review.googlesource.com/c/website/+/296383
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-05-26 13:31:17 +00:00
Russ Cox 6edac51689 cmd/golangorg: remove special cases for /project/, /doc/devel/release
The special cases were simulating the normal template execution
and passing extra data (the release history).
We have a standard way to pass extra data (template functions),
so use one and delete the special case code.

Also change date format to standard yyyy-mm-dd.
The yyyy/mm/dd we have been using is kind of made up
and certainly unusual (see https://xkcd.com/1179/).

Change-Id: I59f4f67259381dd43cd53c0f6120f87d8f8c77d9
Reviewed-on: https://go-review.googlesource.com/c/website/+/296429
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-05-18 15:19:37 +00:00
Sean Liao 254f4b84c9 cmd/golangorg: fix local docker instructions
Change-Id: Iada6af41a5831af6ff2a5d1e3459529992eb95d3
Reviewed-on: https://go-review.googlesource.com/c/website/+/290229
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Trust: Bryan C. Mills <bcmills@google.com>
2021-03-16 15:48:23 +00:00
Russ Cox b09c5abe08 internal/godoc: remove unused configuration
There is lots of dead flexibility in this code.
Remove it, to make the control flow and data dependencies
easier to understand.

Change-Id: Ie9aa7bc96afc64d2a07677a73f8fb311808ef307
Reviewed-on: https://go-review.googlesource.com/c/website/+/296377
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-03-12 19:58:06 +00:00
Russ Cox bcc60328ef cmd/golangorg: move googleCN code out of internal/godoc
Change-Id: I24140d73ca375cd624d852a2653c0a8bb0af9e2d
Reviewed-on: https://go-review.googlesource.com/c/website/+/293492
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-03-12 19:57:57 +00:00
Dmitri Shuralyov 20d504f776 cmd/golangorg: remove /search endpoint case in TestLiveServer
The /search endpoint was removed in CL 293412 and CL 293427.

Change-Id: I0f11a27bad63f68f211b12dcb77e8ace0daadfdc
Reviewed-on: https://go-review.googlesource.com/c/website/+/299369
Trust: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Alexander Rakoczy <alex@golang.org>
2021-03-09 16:50:02 +00:00
Russ Cox 6dc0141a6d cmd/golangorg, internal/godoc: switch from vfs to io/fs
Change-Id: Idf55bca5c9ee20d6612e463ad7fc59ef212171e6
Reviewed-on: https://go-review.googlesource.com/c/website/+/293489
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-02-24 17:36:08 +00:00
Russ Cox 6fbd1cb9fd internal/godoc: delete indexing code
We no longer serve search from the golang.org site.

Change-Id: I8b855cf664f175c0dc46a91e3017df1bebb28281
Reviewed-on: https://go-review.googlesource.com/c/website/+/293427
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-02-24 17:35:58 +00:00
Russ Cox 31042d3351 cmd/golangorg: change imports to use internal/godoc
Change-Id: I48498e0c045d4c4d97ac54d3204165adc71133a6
Reviewed-on: https://go-review.googlesource.com/c/website/+/293421
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-02-24 17:35:34 +00:00
Russ Cox d86265880f cmd/golangorg: fix various comments
Change-Id: I95879652f3c8e44210f1e28e7944755fa2bee676
Reviewed-on: https://go-review.googlesource.com/c/website/+/293417
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-02-24 17:35:24 +00:00
Russ Cox 44a429fa8f cmd/golangorg: clean up, centralize handler registration
All handlers (except the App Engine production ones) should
be registered on the mux protected by hostEnforcerHandler.
Do that, and sort the registrations for easy scanning (by people).

Change-Id: I96813eb105f63bf37abed4898ccf23d1f16cc8d4
Reviewed-on: https://go-review.googlesource.com/c/website/+/293416
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-02-24 17:35:19 +00:00
Russ Cox e37fc2d9d4 cmd/golangorg: make /x redirect message nicer
"Nothing to see here; move along" was a funny throwaway line years ago.
It's a bit confusing now when it appears for a brief moment during
the redirect, especially for people not familiar with the idiom.
Show clearer text.

Change-Id: Ia2e8314e1a9f93e9148fb96aec0278f5815ae230
Reviewed-on: https://go-review.googlesource.com/c/website/+/293415
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-02-24 17:35:13 +00:00
Russ Cox 53c676d0fc _content: create explicit lib/godoc tree
For historical reasons, files in _content/, like _content/play.js,
were served as https://golang.org/lib/godoc/play.js.
Remove some complex setup by moving them to names that
match the actual serving location, such as _content/lib/godoc/play.js.

Change-Id: Ib92c3db7566b24da40e803781aca590f6bc22c8b
Reviewed-on: https://go-review.googlesource.com/c/website/+/293414
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-02-24 17:35:07 +00:00
Russ Cox 66996d0d91 cmd/golangorg: simplify local vs prod programs
There was too much duplicated code between main.go
and appinit.go and too many build-tagged-out files.

Make main.go the func main for both prod and local.
Introduce local.go, merging dl.go and play.go.
Introduce prod.go, holding the prod-specific bits of appinit.go
(the rest are in main.go).

Rename the build tag to prod instead of golangorg
(the whole program is golangorg; it's very confusing).

Fixes golang/go#41102.

Change-Id: I261ce8e9171110f01798025f8218ce9f8253af81
Reviewed-on: https://go-review.googlesource.com/c/website/+/293413
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-02-24 17:35:01 +00:00
Russ Cox fd7d167356 cmd/golangorg: delete index support code
Now that search is turned off, all the index code can be deleted.

For golang/go#41102.

Change-Id: Idb82f2b80cadb5a2d209b5e5995d38c35ffaf8db
Reviewed-on: https://go-review.googlesource.com/c/website/+/293412
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-02-24 17:34:55 +00:00
Russ Cox 3bfcf053d6 cmd/golangorg: fix -a mode (and README.md) for _content move
Change-Id: I78526b4834774ed46c59609467c2b43950f0cc99
Reviewed-on: https://go-review.googlesource.com/c/website/+/292589
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-02-18 03:22:26 +00:00
Russ Cox 6ba27a496a _content: move content/static/* to _content/*
The extra level of hierarchy here is unnecessary and confusing.
The directory is now _content so that any Go source files in our
docs are not considered by commands like "go mod tidy" and
"go test all".

Change-Id: Ib6d7cb12920193798ee825155a8f8b33f16e60d8
Reviewed-on: https://go-review.googlesource.com/c/website/+/291691
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-02-16 02:04:17 +00:00
Russ Cox aefff79d07 content/static: use embed and io/fs
This lets us delete the generated static.go.

For golang/go#41102

Change-Id: Ie09f34a83f114592eec4ba2dd9263285169374ae
Reviewed-on: https://go-review.googlesource.com/c/website/+/291690
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-02-16 02:04:16 +00:00
Russ Cox 08dc0d2188 cmd/golangorg: add -a flag to automatically find templates
We'd like to make it possible for people to run the web site with

	go run ./cmd/golangorg -a

without having to worry about go generate or figuring out the -templates flag.
This is a step in that direction: it sets -templates correctly.

Even so, -templates is still incompatible with Markdown files.

Change-Id: I97afaafdbc66500c674c959383334bf2e5185316
Reviewed-on: https://go-review.googlesource.com/c/website/+/251377
Trust: Russ Cox <rsc@golang.org>
Trust: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-02-12 20:53:17 +00:00
Jonathan Amsterdam 5c5b820cc8 cmd/googlegolangorg: point to pkg.go.dev
Change the redirects to pkg.go.dev from godoc.org

Change-Id: Iecb1f6b16881bedaa47d65427b75b90baa2ae02a
Reviewed-on: https://go-review.googlesource.com/c/website/+/282292
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
2021-01-07 17:01:08 +00:00
Julie Qiu 9bb0e2307d all: replace godoc.org links with pkg.go.dev
Change links from godoc.org to pkg.go.dev.

For golang/go#36106

Change-Id: Ic3ec03efc265cdc332027d538b0c5d4d91bdac24
Reviewed-on: https://go-review.googlesource.com/c/website/+/275195
Trust: Julie Qiu <julie@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2020-12-07 16:54:58 +00:00
Russ Cox 16b2306e2f cmd/golangorg: print service address when serving
This makes it clear that the program isn't still building or hung,
and it also reminds users what port is being used.

Change-Id: I63b27cc34e1ada407c75022f53aa64d7e21647da
Reviewed-on: https://go-review.googlesource.com/c/website/+/251117
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2020-08-27 20:30:05 +00:00
Andrew Bonventre 968e867775 internal/history,cmd/golangorg: add 1.15 and update base ref
Change-Id: I7b3c89f17b9bcaadaed83272950524d28a8be2bf
Reviewed-on: https://go-review.googlesource.com/c/website/+/247682
Run-TryBot: Andrew Bonventre <andybons@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Carlos Amedee <carlos@golang.org>
2020-08-11 21:21:26 +00:00
Andrew Bonventre ef43905be3 cmd/admingolangorg: force https for all paths
Change-Id: I1013687b302d9ddc5005c9ad80d3295b3ee461f4
Reviewed-on: https://go-review.googlesource.com/c/website/+/244338
Run-TryBot: Andrew Bonventre <andybons@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alexander Rakoczy <alex@golang.org>
2020-07-22 20:32:00 +00:00
Dmitri Shuralyov 87e76158b4 internal/history: document upcoming Go 1.14.5 and Go 1.13.13 security releases
They have been pre-announced¹.

Also update the release summary template to not point to the issue
tracker for future releases. The issue tracker is representative of
the final release content only for releases that have been completed.

¹ https://groups.google.com/d/msg/golang-announce/f2c5bqrGH_g/GnH6k56AAAAJ

Change-Id: I1b05a0d6ce3f3f05a441979f529d449a2f49465e
Reviewed-on: https://go-review.googlesource.com/c/website/+/242317
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Katie Hockman <katie@golang.org>
2020-07-13 17:32:15 +00:00
Dmitri Shuralyov 58a31798e8 internal/dl: use /dl/{file} URLs on /dl/ HTML page
The /dl/{file} URLs have been supported for many years but not well
documented. Start using them on the /dl/ HTML page and document them,
so that it is clear that they can be reliably used in scripts or so.

This causes clients to have to make an extra HTTP request (which gets
redirected to the target location serving the file bytes), but compared
to the total work to download a Go file, this is negligible. Clients
that really want to skip the redirect can do so, but the trade-off is
that they need to update the URL if the CDN used for Go file downloads
happens to change. The /dl/{file} links are not expected to change for
Go 1.

Fixes golang/go#38713.

Change-Id: I9df7d5b761baa6fa657c5dd2063c97b9b457367c
Reviewed-on: https://go-review.googlesource.com/c/website/+/238517
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alexander Rakoczy <alex@golang.org>
Reviewed-by: Andrew Bonventre <andybons@golang.org>
2020-06-30 00:42:23 +00:00
Andrew Bonventre 4ae8a49789 cmd/admingolangorg: add command serving an admin interface
This change re-enables the /s/ link shortener admin interface,
running as its own App Engine service on the go111 runtime,
which still supports the “login: admin” option in app.yaml.

+ The golangorg build constraint on the internal/memcache and
  internal/short packages is removed to allow easy import
+ A new function, AdminHandler is introduced in the short package
  to allow for registering the handler outside of it
+ Some page cleanup to leverage modern HTML and JS capabilities,
  obviating the need for jQuery, which has been removed
+ Clients for Redis and Cloud Datastore have been updated to
  the latest versions

Fixes golang/go#29988

Change-Id: If6ca75e85e16a7d86bb5dafcf08b27d2dc36f530
Reviewed-on: https://go-review.googlesource.com/c/website/+/238545
Run-TryBot: Andrew Bonventre <andybons@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2020-06-18 01:33:28 +00:00
Cody Oss ea487986b4 cmd/googlegolangorg: update gocloud to have GitHub source of truth
We have moved gocloud to be a mirror of google-cloud-go.

Change-Id: Ia27a905775b89eac1c7e6407672fb6f4bd1c96d1
GitHub-Last-Rev: 2432f6c5c5
GitHub-Pull-Request: golang/website#10
Reviewed-on: https://go-review.googlesource.com/c/website/+/237197
Reviewed-by: Chris Broadfoot <cbro@golang.org>
2020-06-09 17:33:31 +00:00
Dmitri Shuralyov 5e15fc839b cmd/golangorg: update GCP console UI link
The URL format has changed slightly, update it so that the Flexible
environment filter continues to be active.

Also, avoid printing directions at the end of the publish step in the
Makefile. Doing so creates overlap with the steps already listed in
the README and can be confusing. Instead, point back to the README.

Change-Id: If1d06735dff5744b81ad127e8621a35fa5bf167b
Reviewed-on: https://go-review.googlesource.com/c/website/+/234679
Reviewed-by: Chris Broadfoot <cbro@golang.org>
2020-05-20 21:54:10 +00:00
Chris Broadfoot c7d8b1c4e2 cmd/googlegolangorg: update Google API repo URLs
We are moving google-api-go-client to GitHub.

Change-Id: I1f231032f6881f0167dd742a0e46f725326ffca8
Reviewed-on: https://go-review.googlesource.com/c/website/+/234532
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2020-05-20 20:57:02 +00:00
Dmitri Shuralyov 050186bdd1 cmd/golangorg: add golang.org/x/pkgsite repository
Allow golang.org/x repos to opt-in to use pkg.go.dev for documentation.
The golang.org/x/pkgsite repository is the first one to use it.

Update to current golang.org/x/build version and regenerate:

	go get golang.org/x/build/repos@92427f67eca1ac8f769c740f272196f368082630
	go mod tidy
	go generate ./...

Fixes golang/go#39150.
For golang/go#36747.
For golang/go#36106.

Change-Id: Ia91725c12546c4e7467601d951144af3cb1e6863
Reviewed-on: https://go-review.googlesource.com/c/website/+/234678
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
2020-05-20 14:40:36 +00:00
Andrew Bonventre a8c73cefdc all: update license headers for consistency
There were a few files with different wording in the license header
than is present in the rest of the repository. Update these to say
“BSD-style” instead of “Apache 2.0”.

Change-Id: I24df0e69fbd18728dcf1aec8166c5a52407930f6
Reviewed-on: https://go-review.googlesource.com/c/website/+/231159
Reviewed-by: Alexander Rakoczy <alex@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2020-05-01 20:48:09 +00:00
Dmitri Shuralyov 0d8ef50e56 cmd/golangorg: generate major version list on Go project page
This change builds on what was done in CL 229081, and uses the Go
release history data from internal/history package to generate the
list of major Go versions on the Go project page.

This way, this page doesn't need to be manually edited when major
Go releases are made.

For golang/go#38488.
For golang/go#29205.
For golang/go#29206.

Change-Id: Ie0b12707d828207173a54f0a1bc6a4ef69dcedef
Reviewed-on: https://go-review.googlesource.com/c/website/+/229483
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alexander Rakoczy <alex@golang.org>
2020-04-24 14:48:01 +00:00
Dmitri Shuralyov b4ea521127 internal/history: rename Version to GoVer
Make it more clear that this type represents a Go-specific version,
rather than a version that follows the Semantic Versioning 2.0.0
specification. The type already has Go-specific methods, for example
IsMajor reports true for "1.14" and IsMinor reports true for "1.14.1".
This is consistent with the terminology used by Go releases, but
very surprising if considered from the perspective of semver.

Document some differences of the Go-specific version convention
compared to semver, and describe the X, Y, Z fields in more detail.

This change makes it viable to add a String method to GoVer type
documented to print a Go-specific version string, which will be
useful in more places in CL 229483.

For golang/go#32450.

Change-Id: If7482fdb4a739ff5b89b7133402d94412057f590
Reviewed-on: https://go-review.googlesource.com/c/website/+/229481
Reviewed-by: Carlos Amedee <carlos@golang.org>
2020-04-23 19:23:00 +00:00
Dmitri Shuralyov e9020e8d94 cmd/golangorg: generate release history page from structured data
Previously, the release history page was a raw HTML file that was
manually edited whenever new Go releases were made. This change
converts release history entries into a structured format in the
new internal/history package, and generates release history entries
from that format.

For now, only Go 1.9 and newer releases are converted, but the
structured format is flexible enough to represent all releases
going back to the original Go 1 release.

Various English grammar rules and special cases are preserved,
so that the release history entries appear in a consistent way.

New release history entries need only to be added to the internal/
history package, making it so that English grammar rules and HTML
tags don't need to go through human code review for each release.
Future work may involve constructing that list from data already
available in the Go issue tracker.

This change makes minimal contributions to reducing the dependence
of x/website on the x/tools/godoc rendering engine for displaying
pages other than Go package documentation. The x/tools/godoc code
is in another module and does not provide flexibility desired for
the general purpose website needs of x/website.

Fixes golang/go#38488.
For golang/go#37090.
For golang/go#29206.

Change-Id: I80864e4f218782e6e3b5fcd5a1d63f3699314c81
Reviewed-on: https://go-review.googlesource.com/c/website/+/229081
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alexander Rakoczy <alex@golang.org>
2020-04-21 19:28:23 +00:00
Dmitri Shuralyov 79a8f22851 cmd/golangorg: set GOPATH to empty directory rather than empty string
When generating an index, point the GOPATH environment variable to
an empty directory. Setting it to the empty string doesn't work as
of Go 1.8, where a default GOPATH value was added¹.

¹ https://golang.org/doc/go1.8#gopath

Change-Id: I9adfa60e8aa9c6931e3752b24720ec6e77932c9a
Reviewed-on: https://go-review.googlesource.com/c/website/+/221105
Reviewed-by: Alexander Rakoczy <alex@golang.org>
Run-TryBot: Alexander Rakoczy <alex@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2020-02-26 17:57:44 +00:00
Dmitri Shuralyov 441f74967e cmd/golangorg: use 8 letters to form index split suffix
The default suffix length is 2 letters, which can cause split files to
have suffixes such as .cc, .go, and so on. Files with those suffixes
are misinterpreted to be source code files, and prevent the golangorg
command from building successfully.

Avoid this problem by using a suffix of length 8.

Use a single space to separate flags and values, for consistency.

Change-Id: I5120286a6f56091db8e46e6a74ca2eb98994de60
Reviewed-on: https://go-review.googlesource.com/c/website/+/220997
Reviewed-by: Alexander Rakoczy <alex@golang.org>
Run-TryBot: Alexander Rakoczy <alex@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2020-02-25 21:17:52 +00:00
Carlos Amedee cab3a81fad content/static/doc/devel: document Go 1.14
Added the Go 1.14 entry in the releases page.

Updated the GO_REF value in the deployment Makefile to
use the release-branch.go1.14 branch.

Change-Id: Ic66da008fa262ba642a2dbff775bee0ee70c1bf7
Reviewed-on: https://go-review.googlesource.com/c/website/+/220899
Reviewed-by: Alexander Rakoczy <alex@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Alexander Rakoczy <alex@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2020-02-25 19:47:45 +00:00
Dmitri Shuralyov eea9a1a6a7 cmd/golangorg: update deploy instructions
Increase the separation between each step by giving them explicit
numbers. Expand on some of the deploy steps with more detail.

Update the default value of GO_REF to the current Go release branch
version. This way, it doesn't need to be overridden for each deploy.

Update references to the README.md file (it was recently renamed from
README.golangorg-app in CL 207438).

Change-Id: Ie34fed44a990a5c7ffe2acad68fd5c0f094f9143
Reviewed-on: https://go-review.googlesource.com/c/website/+/212239
Reviewed-by: Carlos Amedee <carlos@golang.org>
2020-01-03 21:34:28 +00:00
Brad Fitzpatrick 12a8390500 cmd/golangorg: remove duplicate list of repo names from the /x/ handler
Also, add tests.

This also removes the golang.org/x/codereview redirect because
code.google.com and our Mercurial repository are long dead.

Updates golang/go#36047

Change-Id: I0aacbe5a963b0edeea2dd2f1b2e2ad6a2f1f7319
Reviewed-on: https://go-review.googlesource.com/c/website/+/210744
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2019-12-13 22:53:24 +00:00
Russ Cox c0a416a8e8 cmd/golangorg: update README
Make the README cover local non-production mode too,
update file name to match, and convert to markdown.

Change-Id: I7e3c86bf4ae2a3aeaed2dd2e3134747a275a006b
Reviewed-on: https://go-review.googlesource.com/c/website/+/207438
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2019-11-18 17:23:35 +00:00
Russ Cox 99763cba2e static/doc: copy Code of Conduct, static/doc/conduct.html, from Go repo
The Code of Conduct is copied from Go master as of Nov 15 2019 (9b68ef81e606)
with a change to update the Project Stewards (now Carmen Andoh and Van Riper),
and no other changes.

This CL also updates static/gen.go to include this file
and regenerated static/static.go.

Change-Id: Ic639b821031f2ad41727728b3dc3b5b69e6d5265
Reviewed-on: https://go-review.googlesource.com/c/website/+/207437
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2019-11-15 21:09:41 +00:00
Dmitri Shuralyov c6c84f4e11 cmd/golangorg: migrate from legacy to split health checks
For now, continue to use the existing /_ah/health HTTP endpoint
for both the liveness and readiness checks. This is simple and
close to the previous legacy health check behavior. In the future,
we can consider making the readiness check more sophisticated.

This change should make golangorg deployable again after the
deprecation of legacy health checks.¹

¹ https://cloud.google.com/appengine/docs/flexible/go/migrating-to-split-health-checks

Change-Id: Ia68d3b260dd3a5b66f969318a04b8f97639701d6
Reviewed-on: https://go-review.googlesource.com/c/website/+/201743
Reviewed-by: Katie Hockman <katie@golang.org>
2019-10-17 22:01:48 +00:00
Jean de Klerk 0f2165bae3 cmd/golangorg: provide an example in -template help message
Change-Id: I33ad64c9202e95e5e1296cb1c5fadb7353bbac86
Reviewed-on: https://go-review.googlesource.com/c/website/+/199059
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2019-10-04 19:57:54 +00:00
Jay Conrod 62992fdc34 content/static/doc: link module blog posts from golang.org/doc
Updates golang/go#33637

Change-Id: I37c81d2358c9b2c7ae11939b3884acea2612ff7d
Reviewed-on: https://go-review.googlesource.com/c/website/+/197640
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2019-09-30 22:44:16 +00:00
Jay Conrod efeb14978e cmd/golangorg, content: serve /doc from content/static/doc before GOROOT/doc
In the "/doc" directory, files are now served from the
content/static/doc, then from GOROOT/doc (where GOROOT is either a zip
file or the GOROOT directory).

This allows documentation to be moved to golang.org outside of the
normal Go release cycle. For example, this CL moves (but does not
modify) doc/docs.html here. Documentation that is tied to the Go
release cycle (for example, doc/spec.html) will not be moved.

Updates golang/go#33637
Updates golang/go#29206

Change-Id: I5f1c577e0ffddc3418653bdd9b0cc36cf79e3fe1
Reviewed-on: https://go-review.googlesource.com/c/website/+/197638
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2019-09-30 22:43:31 +00:00
Dmitri Shuralyov 07c3481f1c cmd/golangorg: remove -url flag
The -url flag is unused. It had relatively niche
use-cases and was mostly a relic from cmd/godoc.

It's also completely non-functional due to a few bugs and
the fact CL 162907 hasn't been backported to x/website.

Instead of fixing it and adding tests, remove it.
If it becomes needed in the future, it can be re-added.

Update golang/go#29206

Change-Id: I4a460f460a757c78c3e26d7c97556c623c8dbed4
Reviewed-on: https://go-review.googlesource.com/c/website/+/197722
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Andrew Bonventre <andybons@golang.org>
2019-09-30 15:46:28 +00:00
Dmitri Shuralyov 42bb7571a1 cmd/golangorg: re-add documentation for flat presentation mode
The documentation of the "flat" presentation mode was removed
inadvertently as part of post-CLI-removal documentation cleanup
in CL 143077. The FlatDir flag still exists and is supported.
This change re-adds it to cmd/golangorg documentation.

Also fix a typo in the "src" presentation mode description.

(This is a re-apply of CL 162984 into x/website.)

Updates golang/go#25443
Updates golang/go#29206

Change-Id: I84145bf38f008678a8d8f3d3346f646aa7811886
Reviewed-on: https://go-review.googlesource.com/c/website/+/197721
Reviewed-by: Andrew Bonventre <andybons@golang.org>
2019-09-30 15:39:45 +00:00
Dmitri Shuralyov a0f360c43d cmd/golangorg: remove autocert support
It was unused and incomplete.

It was potentially needed a while ago, back when the golang.org
website was running on a different Google Cloud Platform service.

It's not needed now, and can be re-added in the future
if it becomes needed again.

Change-Id: Id52945adf18b1e34f411f9a2eef6bd21889c6c1a
Reviewed-on: https://go-review.googlesource.com/c/website/+/197957
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Andrew Bonventre <andybons@golang.org>
2019-09-30 15:39:20 +00:00
Dmitri Shuralyov a9a9c92a2c cmd/golangorg: change tab width from 8 to 4 in production
Remove the override, use the default godoc.Presentation value of 4.
This increases consistency across various Go websites, and reduces
the amount of blank horizontal space use.

Fixes golang/go#34448

Change-Id: Ie3e40f13e6275e74e79c46bbc242d4e5ad95ffda
Reviewed-on: https://go-review.googlesource.com/c/website/+/196937
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Andrew Bonventre <andybons@golang.org>
2019-09-23 17:41:45 +00:00
Wagner Riffel a744e31f9c cmd/golangorg: rewrite reference to plan9.bell-labs.com to 9p.io
Change-Id: Ib8253a4f910908fb45829b6443e87248a1ba20b4
Reviewed-on: https://go-review.googlesource.com/c/website/+/192817
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-09-03 15:38:57 +00:00
Bryan C. Mills 86c029248e cmd/golangorg: skip tests that require godoc when the 'go' binary is not available to build it
Fixes golang/go#33946

Change-Id: Ib4d14a3acad1c610e4c07dcff1a56757cd9492c8
Reviewed-on: https://go-review.googlesource.com/c/website/+/192329
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alexander Rakoczy <alex@golang.org>
2019-08-29 18:10:42 +00:00
Andrew Bonventre 5f7150705a cmd/googlegolangorg: add GAE app that serves google.golang.org
This code was originally in Google's internal repo, but there's
no good reason for it to stay there.

Change-Id: Id2cd2b2bb3691a14182a02e01c40005652106402
Reviewed-on: https://go-review.googlesource.com/c/website/+/191160
Reviewed-by: Katie Hockman <katie@golang.org>
2019-08-22 16:35:27 +00:00
Agniva De Sarker 36c7869657 all: remove static analysis code
It wasn't being used in golangorg. So we remove it and just let it
be in godoc.

Fixes golang/go#33270

Change-Id: I5c2b4afcb216f1e661011e8d8a5ffe928be9bea8
Reviewed-on: https://go-review.googlesource.com/c/website/+/187537
Run-TryBot: Agniva De Sarker <agniva.quicksilver@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Andrew Bonventre <andybons@golang.org>
2019-07-30 04:11:47 +00:00
Andrew Bonventre df01d8eb50 cmd/golangorg: remove call to flag.Parse in regtest init func
flag.Parse during init is always incorrect (other packages may
want to register flags).

Updates golang/go#31859

Change-Id: Id65bfaab52075220897aacb78c4a7bb6dba16c58
Reviewed-on: https://go-review.googlesource.com/c/website/+/187738
Reviewed-by: Agniva De Sarker <agniva.quicksilver@gmail.com>
2019-07-27 17:10:05 +00:00
Andrew Bonventre 486d4d1944 cmd/golangorg: correct usage text to use golangorg
Also updates some package documentation.

Fixes golang/go#32274

Change-Id: Ie8ed9c34af6f257bba1adf50b6487c4714289a21
Reviewed-on: https://go-review.googlesource.com/c/website/+/185757
Reviewed-by: Alexander Rakoczy <alex@golang.org>
2019-07-12 17:04:05 +00:00
Andrew Bonventre 3ba8e86b8f cmd/golangorg, content/static: update site footer with new design
This also adds a new page, copyright.html, with the longer copyright
text currently in the footer.

Some minor changes were made to godocs.js to ensure that a UI
element used by the analysis features is hidden properly. Otherwise
a black line shows up at the bottom of the page.

Updates golang/go#9936

Change-Id: Ie92b3b5a97d4969b7499f9e1ef9f8fad337b3aa0
Reviewed-on: https://go-review.googlesource.com/c/website/+/183038
Reviewed-by: Katie Hockman <katie@golang.org>
2019-06-20 15:45:40 +00:00
Andrew Bonventre d83058ced3 cmd/golangorg,content/static: render homepage using local root.html
This change alters the behavior to use a local copy of root.html
to render the homepage of golang.org. It is copied directly from
revision b7422f2128 of doc/root.html
in the main go repository.

This will enable changes to be made to the homepage without having
to cherry pick them to a release branch.

Updates golang/go#9936
Updates golang/go#29206

Change-Id: I68a6ef017b969f8838f466721bce51c1b8a358d8
Reviewed-on: https://go-review.googlesource.com/c/website/+/180959
Reviewed-by: Katie Hockman <katie@golang.org>
Reviewed-by: Chris Broadfoot <cbro@golang.org>
2019-06-06 20:13:14 +00:00
Andrew Bonventre 93cbed2a2a Dockerfile.prod: use proxy.golang.org
Also update builder to Go 1.12

Change-Id: I87b25aa9cdd826c77ff71f6dc6166d868642ea19
Reviewed-on: https://go-review.googlesource.com/c/website/+/178238
Reviewed-by: Katie Hockman <katie@golang.org>
2019-05-20 21:50:49 +00:00
Andrew 59066758e3 cmd/golangorg: add x/mod repo to redirect map
Updates #31761

Change-Id: Ie98bad27f490b282948a5821bf3b191def7ae7b8
Reviewed-on: https://go-review.googlesource.com/c/website/+/176559
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-05-10 17:30:33 +00:00
Dmitri Shuralyov c7db086a28 internal/env: use golangorgenv package from x/tools
This change de-duplicates the same configuration used between
the previous x/tools/godoc/env package and x/website's own
internal/env package. It does so by using the new golangorgenv
package.

This makes it possible to remove the old GODOC_PROD and
GODOC_ENFORCE_HOSTS env vars from app.prod.yaml.

The IsProd configuration value was very generic and yet being
used only in one place. Replace it with a more targeted one.
The new name does a better job of communicating what the
implications of setting or not setting it are.

Apply the same change to logic of googleCN as in CL 165459.

Update the required version of the x/tools module to a newer version
that includes CL 160837, which is required for this change.

Starting with this change, we're changing the x/website policy in that
it's now allowed to start using newer versions of subrepos from the
master branch, rather than only using the release-branches of subrepos.
This is in line with the goal of making x/website more self-contained
and less constrained by the Go release schedule.

Updates golang/go#29206

Change-Id: If8847e9276fb18e3ded56fabbf915cdd19176699
Reviewed-on: https://go-review.googlesource.com/c/website/+/165837
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-03-29 17:21:28 +00:00
Channing Kimble-Brown f2d3a2668c cmd/golangorg: add GODOC environment variables to prod
While x/website relies on environment variables with the GOLANGORG_
prefix (as defined in app.prod.yaml), the required version of the
x/tools/godoc package relies on environment variables with the
GODOC_ prefix. So when it doesn't find them, it defaults to
GODOC_PROD and GODOC_ENFORCE_HOSTS being false. This causes the
website's share settings to not be set properly.

To resolve this issue we are adding GODOC_PROD and
GODOC_ENFORCE_HOSTS variables to x/website's app.prod.yaml
explicitly with the intention of deleting them in the future when
it is safe to do so.

Updates golang/go#29206

Change-Id: I5db74d680241b532f51bcc73eb51151e9f60483f
Reviewed-on: https://go-review.googlesource.com/c/164818
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2019-03-01 19:41:04 +00:00
Dmitri Shuralyov 2827872edd cmd/golangorg: link to a more narrow list of old versions
Update the GCP console link to have an Environment=Flexible filter,
so the list of old website versions doesn't include extraneous entries.

The versionsquery query parameter is not easily readable, but it's what
GCP uses. It encodes the following information:

	[{"k":"env","t":10,"v":"\"FLEXIBLE\"","s":true}]

Remove the versionssize=50 query parameter, since it's not critical,
to make the URL shorter and easier to copy.

Change-Id: I09e7c25191668af10aef0783b2760af3b7873654
Reviewed-on: https://go-review.googlesource.com/c/163177
Reviewed-by: Channing Kimble-Brown <channing@golang.org>
2019-02-20 19:46:52 +00:00
Channing Kimble-Brown c68b58d296 cmd/golangorg: deploy to default service
This CL changes the deployment scripts so that they deploy x/website to
golang.org (GCP service name: default). x/website is now the canonical
source of golang.org.

Updates golang/go#29206

Change-Id: If29be6b191b84ac8856e4c0aa6239f96da41629b
Reviewed-on: https://go-review.googlesource.com/c/162157
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2019-02-20 16:41:46 +00:00
Channing Kimble-Brown 45f521b524 cmd/golangorg, internal/env: make deployment work for x/website
This change is part of an effort to deploy x/website to its own
subdomain on GCP. Everything needs to be working properly on the
subdomain before x/website can become the canonical website
(golang.org). There is currently a functional deployment of
x/website to the 'new-website' service under golang-org on GCP.

With these specific changes, x/website gets deployed to the
service 'new-website'. By changing both the service field in
app.prod.yaml and the GCP_SERVICE variable in Makefile to
'default', these files could be used to deploy x/website to
the 'default' service as well.

Updates golang/go#29206

Change-Id: I47340333b9e09672e8588c330d629857d1d0bf0d
Reviewed-on: https://go-review.googlesource.com/c/161198
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2019-02-11 23:02:24 +00:00
Channing Kimble-Brown 902c675d52 cmd/golangorg: use go/doc instead of x/website/content/doc
This is the first step towards deduplicating the doc folder so
that any changes in go/doc don't have to be backported to
the x/website repo. In the long term, the doc folder will
ultimately live in x/website, but that will be prioritized later
once x/tools has had website related code properly moved to
x/website.

Updates golang/go#29206

Change-Id: I1c5d200e9e72d3e24bc87f79e1d34faa8c9af36b
Reviewed-on: https://go-review.googlesource.com/c/160237
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2019-01-29 22:31:47 +00:00
Channing Kimble-Brown 6e81c213a8 cmd/golangorg: add xerrors to x.go
Backporting the change from CL 159739 since updates to
x/tools/cmd/godoc are not automatically mirrored to cmd/golangorg

Updates golang/go#29206

Change-Id: Ic377255b321ab73cfb04513aa00a510e407a2bdf
Reviewed-on: https://go-review.googlesource.com/c/160137
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-01-29 18:33:20 +00:00
Channing Kimble-Brown 1459be3397 cmd/golangorg, internal: use newly copied x/website/internal packages
Now that the internal directory contains copies of the packages
from x/tools/godoc the import paths and dependencies can refer
to accessible files. The build now works for both the app engine
and non app engine configurations.

Updates golang/go#29206

Change-Id: I3ac8070b8a3c01d0ca40e3f5586d05fc9b5bb8ff
Reviewed-on: https://go-review.googlesource.com/c/159918
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Katie Hockman <katie@golang.org>
2019-01-29 15:17:29 +00:00
Channing Kimble-Brown d25929e750 website: use modules
Now the website is using modules, specifically using x/tools version
v0.0.0-20190124215303-cc6a436ffe6b to ensure that the website will
continue to work.

Also minor change to rename README.golangorgserver-app as README.golangorg-app
to reflect the current name of the website binary.

Updates golang/go#29206

Change-Id: I284de2152093ac0a6fcdecbfa185d091435c5691
Reviewed-on: https://go-review.googlesource.com/c/159897
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2019-01-28 21:39:59 +00:00
Channing Kimble-Brown 0bfdc967e5 cmd/golangorg/godoc: delete packages
The godoc package and the packages inside (an exact copy of
x/tools/godoc) are being removed from x/website/cmd/golangorg
because the package should not be in the folder used to build
the binary when it's being used as a library. Also, all the work
to turn documentation-rendering into a library separate from
x/website and the godoc binary will be done in x/tools/godoc.
Over time files and packages that are solely used by the website
will be moved back into this repo. All corresponding path name
changes were made to all files importing the godoc/... packages.

Updates golang/go#29206

Change-Id: I13740b66b967fc413eed7e90bff54f859cf36150
Reviewed-on: https://go-review.googlesource.com/c/159737
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-01-28 21:19:52 +00:00
Channing Kimble-Brown da9e5ccbe1 x/website: add code and static files for website
All of the code and static assets that the website uses to run have been
copied to this repo. There was also a few lines of code added telling
the website where the doc directory, favicon.ico and robots.txt are.

go repo change-id: Ife6443c32673b38000b90dd2efb2985db37ab773
x/tools repo change-id: Ia979a8b06d1b4db47d25ffdfdf925ba8a0ac67de

Real new code additions:
- main.go
    * lines 89-95 added getFullPath method
    * lines 217-222 mapped paths to doc/, favicon.ico, robots.txt in vfs
- appinit.go
    * lines 147-153 added getFullPath method
    * lines 80-84 mapped paths to doc/, favicon.ico in vfs

Several files were copied from x/tools and go so paths (and corresponding
import paths) were changed as follows:

"x/tools/cmd/godoc/" --> "x/website/cmd/golangorg/"
"x/tools/godoc/static/" --> "x/website/content/static/"
"x/tools/godoc/" (without godoc/static/) --> "x/website/cmd/golangorg/godoc/"
"x/tools/internal/memcache" --> "x/website/internal/memcache"
"go/doc/" --> "x/website/content/doc/"
"go/favicon.ico" --> "x/website/favicon.ico"
"go/robots.txt" --> "x/website/robots.txt"

Updates golang/go#29206

Change-Id: I53985fc027f73e60c6946038f85133acf1ecb08c
Reviewed-on: https://go-review.googlesource.com/c/156321
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-01-08 18:22:29 +00:00