The playground js was coming from
godoc instead of the updated copy in go.dev.
Change-Id: I26be8634b0e5d453b966be758f08c15b4bc7ca72
Reviewed-on: https://go-review.googlesource.com/c/website/+/366376
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Website-Publish: Russ Cox <rsc@golang.org>
This is the last user-facing golang.org domain.
Now everything is on go.dev.
Change-Id: I8d9f4b7609a019f077848825cbd417d38058a5ac
Reviewed-on: https://go-review.googlesource.com/c/website/+/365494
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
This is an almost unmodified copy of
golang.org/x/tools/cmd/present/dir.go
as of 43b469a (Nov 17 2021).
The only modification is adding a '//go:build ignore' line.
Checking this file in will let the next CL show the diffs
for adaptation to x/website.
Change-Id: I808886338df44878b728be096b91b6aa8179be56
Reviewed-on: https://go-review.googlesource.com/c/website/+/365134
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
tour.golang.org is the last independent server in this repository
and almost the last golang.org domain with user-facing content.
(talks.golang.org remains.)
We need to keep golang.org/x/website/tour as a runnable binary,
but move the logic into internal/tour so it can be used from both
the tour binary and cmd/golangorg.
After this is deployed, we will need to delete the current tour app
from the golang-org project, and then requests for tour.golang.org
will default to the main server (cmd/golangorg).
This will make the tour available in China for the first time,
at golang.google.cn/tour.
Change-Id: I0f025d8ae89e12489d26bb3bc380a833eeb57bcc
Reviewed-on: https://go-review.googlesource.com/c/website/+/365100
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
Now that there is one site, update all golang.org links to go.dev.
But for any links being served from go.dev, make host-relative,
so that when serving golang.google.cn, we stay on that host as
much as possible.
Change-Id: Id6e1303059b5522846a64202bc1a8b81dc3854cd
Reviewed-on: https://go-review.googlesource.com/c/website/+/365095
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
As described in https://go.dev/blog/tidy-web,
redirect golang.org to go.dev.
The golang.org home page is retired -
go.dev now has all the same info and links,
and it doesn't have ten-year-old videos of me.
All the other golang.org pages are now served
directly from go.dev, styled differently but with
the same content.
A followup CL will merge the _content directories.
Change-Id: Ib7f3d951842c021280981f9b926c4943f4d9cb52
Reviewed-on: https://go-review.googlesource.com/c/website/+/364859
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
This is a replacement for the UI of play.golang.org,
although it still uses play.golang.org as the backend
and probably always will, to keep the playground backend
deployment separate from the rest of the web site.
Change-Id: Ia39000e80368b98d9cc273d246f2c83670fbacc4
Reviewed-on: https://go-review.googlesource.com/c/website/+/364815
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
This makes internal/short like most of the other registrations.
Preparation for the golang.org -> go.dev move.
Change-Id: I55039d6d668ac38ddb8e2412b7ab7ff44db8dd97
Reviewed-on: https://go-review.googlesource.com/c/website/+/362497
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
Added a copy of the datastore content for use offline.
This lets us test download page rendering locally.
Preparation for the golang.org -> go.dev move.
Change-Id: Ic0c49a96329eed4310dd91e03c4ea832189ef65a
Reviewed-on: https://go-review.googlesource.com/c/website/+/362496
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
Change-Id: Ice3c14820da241b24394bc38ab7b30fad4de656d
Reviewed-on: https://go-review.googlesource.com/c/website/+/361201
Trust: Than McIntosh <thanm@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Website-Publish: DO NOT USE <dmitshur@google.com>
Change-Id: I555f2e1c396ceffc7819cf423226f556bb4af5f5
Reviewed-on: https://go-review.googlesource.com/c/website/+/354570
Reviewed-by: Heschi Kreinick <heschi@google.com>
Run-TryBot: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Michael Knyszek <mknyszek@google.com>
Website-Publish: DO NOT USE <dmitshur@google.com>
Change-Id: I64708dacaed4afc24332fb79a3ad3b4cf586514e
Reviewed-on: https://go-review.googlesource.com/c/website/+/348809
Trust: Than McIntosh <thanm@google.com>
Run-TryBot: Than McIntosh <thanm@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Website-Publish: DO NOT USE <dmitshur@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
The windows/arm64 port is new to Go 1.17 and one of its key features.
Highlight the Windows ARM64 installer, just like the Windows AMD64
installer is highlighted. (Keep the zip archives and 386 installer
not highlighted.)
For golang/go#36439.
Change-Id: Ib57e80465d0ca090d165e14e3c4afdb2efca0c11
Reviewed-on: https://go-review.googlesource.com/c/website/+/344070
Trust: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
ARM64 makes for a better pretty string for the "arm64" architecture.
It's more clear that it's 64-bit, and it's closer to what we almost
always say.
Thanks to Cherry for making this suggestion.
For golang/go#38485.
For golang/go#36439.
Change-Id: I89c175ea2bafce6f191ae797ed982c73962ee5da
Reviewed-on: https://go-review.googlesource.com/c/website/+/344069
Trust: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
Go 1.16 is available on App Engine now, so use it.
Also, Go 1.17 has been released, meaning
we don't need to keep Go 1.15 builders working.
Delete all the Go 1.16 backports except the template packages,
which contain modifications we need.
Change-Id: I4612441a1484ce9272a22268da73d67f7624309b
Reviewed-on: https://go-review.googlesource.com/c/website/+/343935
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
Featured downloads on golang.org/dl use the latest Go release, which
is now Go 1.17. Per golang.org/doc/go1.17#darwin, Go 1.17 requires
macOS 10.13 High Sierra or later.
For golang/go#23011.
Fixesgolang/go#47867.
Change-Id: I868d118f073977c74429d70ae9ab7c526d098cf7
Reviewed-on: https://go-review.googlesource.com/c/website/+/344071
Trust: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Paul Jolly <paul@myitcv.org.uk>
Also hard-code EnforceHosts behavior.
It was only optional to enable the old tip.golang.org server,
but that code is dead or at least no longer pointed to by DNS.
Hard-coding the EnforceHosts behavior makes for fewer
prod-only test failures.
Change-Id: Ib958b3f088c8175e67708efcd07426b9628b207b
Reviewed-on: https://go-review.googlesource.com/c/website/+/343311
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
This is the first of a sequence of consolidations of web sites into
the single site go.dev. An accompanying blog post (next CL) will
explain the change.
The blog/_content tree moves to go.dev/_content/blog.
The *.article files were converted to *.md files using rsc.io/tmp/blog2md.
The old dot directives are now template function invocations,
so that blog content files are now exactly the same format and
semantics as regular site content files.
All the old blog redirects are carried forward, of course.
Also add exhaustive test that every .md file renders correctly.
Also rename rawhtml to raw, because it gets used for raw Markdown too.
The raw Markdown issue is working around a bigger problem
(html/template is not really right for Markdown) that we will have
to solve at some point, but not in this CL.
Change-Id: Ifa9b3b8d656a72af30d0d4e57e4c7bc8dacbc386
Reviewed-on: https://go-review.googlesource.com/c/website/+/342091
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
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>
There's no real need for these to be written in Go.
Change-Id: Ifb3ebc99a06bb9670a39238a1ddf370c2dcd6a22
Reviewed-on: https://go-review.googlesource.com/c/website/+/339402
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
Make internal/tmplfunc available to the whole module,
as one more step toward merging internal/web and go.dev/cmd/internal/site.
Also bring in rsc.io/tmplfunc support for fs.FS.
Change-Id: I65486c32136ec500de172b8297d0605fef9d5c83
Reviewed-on: https://go-review.googlesource.com/c/website/+/339401
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
Change-Id: Idbb89a88af787472e48bbc3f437462842156af3f
Reviewed-on: https://go-review.googlesource.com/c/website/+/342483
Trust: Michael Knyszek <mknyszek@google.com>
Run-TryBot: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Website-Publish: DO NOT USE <dmitshur@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
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>
This code is new and not anywhere else at the moment.
It is for a new implementation of tip.golang.org.
Change-Id: I176630816587387c08cdc53993889a5009612565
Reviewed-on: https://go-review.googlesource.com/c/website/+/328213
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>
Change-Id: I7650239269944f3f48876cb57174ed9ffc63c1d1
Reviewed-on: https://go-review.googlesource.com/c/website/+/340169
Trust: Alexander Rakoczy <alex@golang.org>
Run-TryBot: Alexander Rakoczy <alex@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Website-Publish: DO NOT USE <dmitshur@google.com>
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>
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.
Fixesgolang/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>
Change-Id: I2a585536147bd030f1bb333c05ffa45ef656bfcc
Reviewed-on: https://go-review.googlesource.com/c/website/+/334069
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>
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>
Change-Id: Ic87f3bf158b573a9773e999d79860fba58f2a92c
Reviewed-on: https://go-review.googlesource.com/c/website/+/332069
Trust: Than McIntosh <thanm@google.com>
Run-TryBot: Than McIntosh <thanm@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Goldmark has a bug that causes crashes in inputs
containing mixed spaces and tabs. Avoid it by removing tabs.
Change-Id: I4c678fce6c68bf0d448ed0b75a2ac12a42891ec6
Reviewed-on: https://go-review.googlesource.com/c/website/+/331349
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Steve Traut <straut@google.com>
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>
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>
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>
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>
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>
This will let us use these APIs on App Engine before Go 1.16 is available.
The only thing we can't backport from Go 1.16 is embed, so that has to
be build-tagged off still, but we don't really need embed on App Engine.
This will let us move golang.org off App Engine Flex onto regular App Engine,
which will greatly simplify deployment and make it possible to do automatic
deployments.
When App Engine adds Go 1.16 support, most of this can go away.
(The template packages will need to stay, as go.dev will need some
Go 1.17 bug fixes from them.)
Change-Id: I16ee64862a43f591a31fae04caf4caa0fdb5af62
Reviewed-on: https://go-review.googlesource.com/c/website/+/323890
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>
This package provides a way to write simple script-based tests of
web server behaviors, instead of reinventing the logic in every test,
as we too often do.
See the doc comment in webtest.go for more details.
Change-Id: Ie1af4f1def488a7520dce46c242643aec15a2fcf
Reviewed-on: https://go-review.googlesource.com/c/website/+/321074
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>
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>
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>
- 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>