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

296 Коммитов

Автор SHA1 Сообщение Дата
Dmitri Shuralyov cb81144c0c internal/history: document future Go 1.18.1 and 1.17.9 releases
These releases have been pre-announced to include a PRIVATE security fix:
https://groups.google.com/g/golang-announce/c/vtbMjE04kPk/m/xE-FGxCXCAAJ.

The fix summary is intentionally left blank until the day of the release,
other than to mention that the issue affects the standard library as the
Go security policy permits disclosing.

In the future, the go.dev website can be improved to display this
information automatically so that it doesn't involve a manual CL.
The motivation for this change was to investigate that the recent
FixSummary type and template are flexible enough to support that.

Change-Id: I340e3b44440cecdb9b25c426f97cd8ff31c60acd
Reviewed-on: https://go-review.googlesource.com/c/website/+/398214
Trust: Dmitri Shuralyov <dmitshur@google.com>
Run-TryBot: Dmitri Shuralyov <dmitshur@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Julie Qiu <julieqiu@google.com>
2022-04-04 21:12:26 +00:00
Dmitri Shuralyov a4d623c5b7 cmd/golangorg, _content/talks: restore talks that use .html command
Invoke the template named "html" using the usual html/template way
instead of invoking it as a function (via the tmplfunc package) to
work around https://github.com/rsc/tmplfunc/issues/1.

The package golang.org/x/tools/present imports "html/template" from
the standard library, so its HTML.HTML field of type template.HTML
isn't understood to be content from a trusted source by the internal
backported copy. Use type aliases for those special types to fix that.

Fixes golang/go#51989.
Updates rsc/tmplfunc#1.

Change-Id: Ib9609f41b17407e297ea3bb111f346188aa7a9b0
Reviewed-on: https://go-review.googlesource.com/c/website/+/396234
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
Trust: Dmitri Shuralyov <dmitshur@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Jamal Carvalho <jamalcarvalho@google.com>
2022-03-29 20:34:17 +00:00
Dmitri Shuralyov cc71b62800 internal/history: split Release summary into bug and security fixes
Make it possible to use the higher-level fix summary fields, instead of
CustomSummary, when a release has both bug fixes and security fixes.

Rewrite the recent hand-written custom summaries to use the new fields,
which produces equivalent output that differs largely in white-space
and some trivial consistency fixes.

Fixes golang/go#51719.
Updates golang/go#38488.
Updates golang/go#44918.

Change-Id: I672cea21f63cb4ab9764efb6cbc783cf503b791c
Reviewed-on: https://go-review.googlesource.com/c/website/+/393357
Trust: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Carlos Amedee <amedee@google.com>
2022-03-21 20:34:41 +00:00
Russ Cox 13fd0169c5 internal/play: add goprevplay, load versions from back ends
This will let us have "Go 1.17" in the dropdown on go.dev/play.
And when the next release happens and goprevplay and play are
updated, the versions will update automatically in the UI.

Change-Id: Id76f89767c3a91a2c9e27c9fbdad5d6fd9674ab2
Reviewed-on: https://go-review.googlesource.com/c/website/+/393840
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
2022-03-18 17:38:43 +00:00
Russ Cox 7a60f303d8 all: handle Go 1.18 code on Go 1.16 AppEngine using new internal/backport/go/*
The immediate need was go/build, because the Go 1.16 go/build rejects
code that has //go:build without // +build, as Go 1.18 code now does.

But displaying code using generics would also have failed, for inability
to parse that code. Add the full go/ast, go/doc, go/format, go/parser,
go/printer, go/scanner, and go/token to fix those failures, which
would become more frequent as generics are used more inside the
standard library.

The code is all from the go1.18 tag of the Go repo, post-processed to
rewrite imports and apply gofmt -w -r 'any -> interface{}' to keep it
building with the other backports and with Go 1.16 syntax.

For golang/go#51686.

Change-Id: I1e14f4634d8bc09bdaa04c014eadb1be97ea5047
Reviewed-on: https://go-review.googlesource.com/c/website/+/393194
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2022-03-15 21:20:57 +00:00
Heschi Kreinick 31e586956f internal/history: add Go 1.18
Change-Id: I20f7bb73f453705fb45d3c914d6b48a66524c3a6
Reviewed-on: https://go-review.googlesource.com/c/website/+/392934
Trust: Heschi Kreinick <heschi@google.com>
Run-TryBot: Heschi Kreinick <heschi@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2022-03-15 17:00:56 +00:00
Jamal Carvalho f520785296 internal/web: fix syntax rules hyperlinks
The filepath for the spec document changed and broke
the linkify step.

Fixes golang/go#50915

Change-Id: Ieafe9c665f4063fb9f9ddf74610925f123e2c249
Reviewed-on: https://go-review.googlesource.com/c/website/+/388859
Run-TryBot: Jamal Carvalho <jamal@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Trust: Jamal Carvalho <jamalcarvalho@google.com>
2022-03-07 15:05:08 +00:00
Carlos Amedee 55c2698e3a internal/history: document Go 1.17.8 and Go 1.16.15
Change-Id: I11c6c82488fb2b17c4b444eca5b85aeaa439b7fc
Reviewed-on: https://go-review.googlesource.com/c/website/+/389735
Reviewed-by: Alex Rakoczy <alex@golang.org>
Trust: Alex Rakoczy <alex@golang.org>
Run-TryBot: Alex Rakoczy <alex@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Run-TryBot: Carlos Amedee <carlos@golang.org>
Auto-Submit: Carlos Amedee <carlos@golang.org>
Reviewed-by: Carlos Amedee <amedee@google.com>
2022-03-03 20:18:44 +00:00
Jamal Carvalho 832feb7309 internal/play: support plain text response
Fixes golang/go#51181

Change-Id: I82f10320e86555a161cbfb5c5b79dfc331017003
Reviewed-on: https://go-review.googlesource.com/c/website/+/388016
Run-TryBot: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Trust: Jamal Carvalho <jamalcarvalho@google.com>
2022-02-25 21:55:09 +00:00
Jamal Carvalho 2c19c4c8fc internal/screentest: capture response status from redirect
Change-Id: I6c7ae3eb3447c67d30b8dc2c4fb02f331ada15c8
Reviewed-on: https://go-review.googlesource.com/c/website/+/385634
Run-TryBot: Jamal Carvalho <jamal@golang.org>
Trust: Jamal Carvalho <jamalcarvalho@google.com>
Run-TryBot: Jamal Carvalho <jamalcarvalho@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2022-02-14 18:38:36 +00:00
Jamal Carvalho aeb216c1e4 internal/screentest: fix http status check
URL fragments are dropped from request targets. Stripping
the fragment from the URL ensures we capture the response
status.

Change-Id: I66ed67a23878315076762e4f99332613a4f67723
Reviewed-on: https://go-review.googlesource.com/c/website/+/385201
Run-TryBot: Jamal Carvalho <jamal@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Trust: Jamal Carvalho <jamalcarvalho@google.com>
2022-02-11 23:55:50 +00:00
Cherry Mui 3450d37756 internal/history: document Go 1.17.7 and Go 1.16.14
Change-Id: I649cecf14658343425094b123ef3c300638d08a9
Reviewed-on: https://go-review.googlesource.com/c/website/+/384435
Trust: Cherry Mui <cherryyz@google.com>
Reviewed-by: Alex Rakoczy <alex@golang.org>
Run-TryBot: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-02-10 23:04:01 +00:00
Jamal Carvalho 59536be9fc internal/screentest: test output improvements
Updated test output to improve discoverability
of failed tests.

Change-Id: I4d70873d47f8cd91f613f6a7b529047e4b4fc053
Reviewed-on: https://go-review.googlesource.com/c/website/+/384841
Run-TryBot: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Trust: Jamal Carvalho <jamalcarvalho@google.com>
2022-02-10 22:36:44 +00:00
Jamal Carvalho 12cc0a88fa internal/screentest: check http status on page load
Requests to URLs are expected to return HTTP Status 200.
To override the expected status code, testcases can use
the status keyword.

Change-Id: Ibe6696fc2fe2a779755ff96dc8c5532c1ce03c66
Reviewed-on: https://go-review.googlesource.com/c/website/+/384840
Run-TryBot: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Trust: Jamal Carvalho <jamalcarvalho@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-02-10 22:36:34 +00:00
Jamal Carvalho c4c0da89ae internal/screentest: remove hostname from output file extension
The original motivation to add hostnames to the files
was to make them easier to identify. Now that the origins
can be dynamically set with template variables, it causes
more trouble than it helps.

After removing the extensions, we can support reusing a
single test script for multiple origins. For example:

  compare {{.Origin}}::cache {{.Origin}}

Origin may be set to https://staging-pkg.go.dev or
http://localhost:8080 and share the same set of screenshots.

Change-Id: I2c1811fcb0fa7cca9e3b5feeb362528fd3f07af4
Reviewed-on: https://go-review.googlesource.com/c/website/+/382157
Run-TryBot: Jamal Carvalho <jamal@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Trust: Jamal Carvalho <jamalcarvalho@google.com>
2022-02-01 20:36:41 +00:00
Jamal Carvalho 55fb4e21dc internal/screentest: add request blocking keyword to scripts
Scripts can use the block keyword to set URL patterns to block.
Wildcards ('*') are allowed.

While loading a webpage if chrome attempts to load a resource
from a blocked URL the request will fail. This is useful for
blocking things like dynamic badge images from a code coverage
or build indicator service.

Change-Id: Ifbde82d56918928333836b493e993c1ef1054a76
Reviewed-on: https://go-review.googlesource.com/c/website/+/381335
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Trust: Jamal Carvalho <jamalcarvalho@google.com>
Run-TryBot: Jamal Carvalho <jamalcarvalho@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-01-27 23:21:54 +00:00
Jason A. Donenfeld 8066ee90a7 internal/dl: show versions in sorted order in JSON listing
When include=all is used, archived versions (old) and unstable versions
(new) are appended to the list of returned versions. This makes the
order of the list rather awkward: current, old, new. This commit makes
the ordering a bit more natural: new, current, old. However, even like
that, releases will be out of order, because, for example, 1.18rc1 is
new, while 1.17.6 is current, but 1.18beta1 is old. So, this commit
takes care to sort the entire list properly to avoid that. This way, the
entire list is sorted by version. Nothing changes semantically, as users
of the API can still filter out unstable releases using the "stable:
true" field.

This commit also adds a test case, to make sure this behavior doesn't
regress.

Fixes golang/go#50201.
Fixes golang/go#47367.

Change-Id: Ic136197dcdd47aa149601b75ba5152a2006c790a
Reviewed-on: https://go-review.googlesource.com/c/website/+/371934
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Run-TryBot: Jason Donenfeld <Jason@zx2c4.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Trust: Jamal Carvalho <jamalcarvalho@google.com>
2022-01-18 17:17:02 +00:00
Jamal Carvalho ec11697842 internal/screentest: log screenshot errors
Adds log output for screenshot errors so they visible
before all testcases complete.

Change-Id: Ida229f256164e16d28fdeedf3671012976659bf3
Reviewed-on: https://go-review.googlesource.com/c/website/+/379135
Run-TryBot: Jamal Carvalho <jamal@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Trust: Jamal Carvalho <jamalcarvalho@google.com>
2022-01-18 16:01:28 +00:00
Jamal Carvalho e26b9f0290 internal/screentest: reduce motion on web pages
Added a stylesheet insertion step that reduces
motion on web pages by speeding up animations
and removing animation delays.

Change-Id: If945f764dfafaebfedce87fa462c5824033808e2
Reviewed-on: https://go-review.googlesource.com/c/website/+/379134
Run-TryBot: Jamal Carvalho <jamal@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Trust: Jamal Carvalho <jamalcarvalho@google.com>
2022-01-18 16:01:17 +00:00
Jamal Carvalho 3bdafedcb3 internal/screentest: update screenshot extensions
The screenshot file extensions are updated such that
when the hostname of the origins for a testcase are
equal, for example when comparing cached screenshots
to live screenshots from the same server, the output
filenames do not collide.

Change-Id: I0b82f94d87912923e734fc30ba457a440ede94f4
Reviewed-on: https://go-review.googlesource.com/c/website/+/378476
Run-TryBot: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Trust: Jamal Carvalho <jamalcarvalho@google.com>
2022-01-18 15:59:52 +00:00
Jamal Carvalho cb323198ea {cmd,internal}/screentest: add config for remote debugger url
To have test runs output consistent screenshots across
different systems we allow for the use of a remote
instance of Chrome by providing a url to its debugger
as a flag. For example:

  go run ./cmd/screentest -d ws://localhost:9222

This is useful in a CI/CD environment to control the
chrome version and OS in which screenshots are taken.

Change-Id: I09b2e2d8e3056d7229808a57653d641677fc8cc3
Reviewed-on: https://go-review.googlesource.com/c/website/+/378475
Run-TryBot: Jamal Carvalho <jamal@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Trust: Jamal Carvalho <jamalcarvalho@google.com>
2022-01-14 17:31:54 +00:00
Jamal Carvalho 41ad36154e {cmd,internal}/screentest: testcases run concurrently
Testcases for screentest will run concurrently
with a configurable max concurrency setting that
defaults to half of number of CPUs on a system.

Change-Id: I07e7ffd8d3867c47b709c160110a58ac60ee357c
Reviewed-on: https://go-review.googlesource.com/c/website/+/377256
Run-TryBot: Jamal Carvalho <jamal@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Trust: Jamal Carvalho <jamalcarvalho@google.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2022-01-10 21:22:00 +00:00
Jamal Carvalho f5c5fdde3f internal/screentest: fix safe extension collection
Previously, obsolete screenshots would only be
cleared if the cache was enabled. This change
ensures all obsolete screenshots are deleted
prior to running tests.

Change-Id: If37caf92446f2174ef293177e9924f61a167cb81
Reviewed-on: https://go-review.googlesource.com/c/website/+/377255
Run-TryBot: Jamal Carvalho <jamal@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Trust: Jamal Carvalho <jamalcarvalho@google.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2022-01-10 20:33:13 +00:00
Jamal Carvalho b3dd1e39e5 internal/screentest: log test output to buffer
Screentest is updated to log test output to a buffer
in preparation for a future CL that will allow for the
parallelization of testcases.

Change-Id: I7e2681cc89bce631552996990fb4ffb390218c8b
Reviewed-on: https://go-review.googlesource.com/c/website/+/377254
Run-TryBot: Jamal Carvalho <jamal@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Trust: Jamal Carvalho <jamalcarvalho@google.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2022-01-10 20:33:01 +00:00
Jamal Carvalho 5dfff35f77 internal/web: update doc
Added documentation of .ts file transforms to web package doc.

Change-Id: I00830e9eea9234bd2867b5f62e8f714b9a0474a0
Reviewed-on: https://go-review.googlesource.com/c/website/+/376075
Run-TryBot: Jamal Carvalho <jamal@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Alex Rakoczy <alex@golang.org>
Reviewed-by: Carlos Amedee <amedee@google.com>
Trust: Carlos Amedee <amedee@google.com>
2022-01-07 21:20:23 +00:00
Jamal Carvalho f4f7323ce3 website: typescript config updates
- Added tsconfig file.
- Set esbuild target.
- Updated eslint rules for JSDoc.

Change-Id: I212bdd58a56540da26cccc8af319a8d98fa9f35a
Reviewed-on: https://go-review.googlesource.com/c/website/+/376074
Trust: Jamal Carvalho <jamalcarvalho@google.com>
Reviewed-by: Alex Rakoczy <alex@golang.org>
2022-01-06 23:48:15 +00:00
Carlos Amedee e63aea0cc5 internal/history: document Go 1.17.6 and Go 1.16.13
Change-Id: Ib96dbc7a4cf70c0c4e3548baef3a77bfc28fb55f
Reviewed-on: https://go-review.googlesource.com/c/website/+/375974
Run-TryBot: Carlos Amedee <carlos@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
Trust: Carlos Amedee <amedee@google.com>
Run-TryBot: Carlos Amedee <amedee@google.com>
2022-01-06 20:42:09 +00:00
Jamal Carvalho 58a5fe9a90 cmd,internal: move typescript transform to web package
To transform .ts files from any path on a site and to ensure
it works for all domains the transform logic is moved to the
web package.

Change-Id: I1ce62eb35dbdfb987ccc2f48e79c558bcdadfbbe
Reviewed-on: https://go-review.googlesource.com/c/website/+/374994
Trust: Jamal Carvalho <jamalcarvalho@google.com>
Run-TryBot: Jamal Carvalho <jamal@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Alex Rakoczy <alex@golang.org>
2022-01-06 01:14:01 +00:00
Russ Cox 4a88b4c112 internal/play: impose time limit on compile proxy
Every day around 3:30pm US Eastern time
the web server seems to get overloaded.
It starts with a suspicious number of 500 responses
from /_/compile relaying to the default back end,
which start timing out after 10 seconds and then
grow longer and longer.

One theory is that the requests are lasting longer
than that and piling up in the system, since we are
using http.DefaultClient, which has no timeout.
Use a client with a 20s timeout to try to clear things
out a bit more promptly.

Change-Id: I7e1659adfcf63d6b712ede4d0fc2b508b3e6bb45
Reviewed-on: https://go-review.googlesource.com/c/website/+/375614
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Jamal Carvalho <jamalcarvalho@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-01-05 19:39:16 +00:00
Jamal Carvalho 86ed12521b internal/screentest: clean output location before test run
Output directories and storage buckets are cleared of
obsolete files and diff results at the start of a test
run.

Change-Id: I96223314641d6958b91e0ec8d69550b3df295949
Reviewed-on: https://go-review.googlesource.com/c/website/+/374774
Run-TryBot: Jamal Carvalho <jamal@golang.org>
Trust: Jamal Carvalho <jamalcarvalho@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2022-01-04 20:37:02 +00:00
Jamal Carvalho 995577f14f internal/screentest: add support for writing test output to GCS
Test scripts parse output locations that begin with gs://
as Cloud Storage buckets. When a bucket is used diff
images and cached screenshots are written to and read from
GCS objects.

Change-Id: I985ccf301ada1bfde82e4e61e1ddf724a824fcb6
Reviewed-on: https://go-review.googlesource.com/c/website/+/373720
Run-TryBot: Jamal Carvalho <jamal@golang.org>
Trust: Jamal Carvalho <jamalcarvalho@google.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-01-04 19:30:38 +00:00
Jamal Carvalho bc5b8e030c internal/screentest: performance improvements
Parallelized screenshot captures and added time
elapsed to log output.

Change-Id: I043c04e09cd478ec96108488b00bdeb4859d2198
Reviewed-on: https://go-review.googlesource.com/c/website/+/373716
Run-TryBot: Jamal Carvalho <jamal@golang.org>
Trust: Jamal Carvalho <jamalcarvalho@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2022-01-04 16:25:19 +00:00
Jamal Carvalho 56b50be279 website: create typescript file handler
To allow for the use of TypeScript in go.dev pages
added a handler for TypeScript files served from
_content/ts. Files requested from this directory
are first transformed from TypeScript to JavaScript
using github.com/evanw/esbuild. JavaScript output is
written to a simple cache so subsequent requests skip
the tranformation step.

Change-Id: I0a161ce3dd20eaddddd5d369d359c65c90d9f607
Reviewed-on: https://go-review.googlesource.com/c/website/+/373718
Run-TryBot: Jamal Carvalho <jamal@golang.org>
Trust: Jamal Carvalho <jamalcarvalho@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Alex Rakoczy <alex@golang.org>
2021-12-29 17:53:46 +00:00
Jamal Carvalho faa0890080 {cmd,internal}/screentest: add support for templates
Screentest scripts are parsed as go templates. Passing
headers from the command line is replaced by the header
keyword in test scripts. Data can be interpolated into
headers using go template strings.

For example `header Authorization: Bearer {{.Token}}`
would become `header Authorization: Bearer abcdef` after
running `screentest -vars "Token:abcdef" testdata/file.txt`.

Change-Id: Ia27b9e12c68ca3bdbe609d3714d57d8867c2b351
Reviewed-on: https://go-review.googlesource.com/c/website/+/373715
Trust: Jamal Carvalho <jamalcarvalho@google.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2021-12-22 16:53:20 +00:00
Jamal Carvalho 91908baf20 internal/screentest: add support for evaluating javascript
Added the eval keyword to allow for evaluating JS. Useful for
manipulating or hiding DOM elements prior to screenshot capture.

Change-Id: I508f3949c2eed7d55fc4e168781ab4c3e00edb5b
Reviewed-on: https://go-review.googlesource.com/c/website/+/373714
Run-TryBot: Jamal Carvalho <jamal@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Trust: Jamal Carvalho <jamalcarvalho@google.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2021-12-21 22:12:49 +00:00
Jamal Carvalho 49c38396ba {cmd,internal}/screentest: add support for request headers
Change-Id: I79ecc613ac12cc0f42edcaee258f3addb5857d69
Reviewed-on: https://go-review.googlesource.com/c/website/+/373654
Trust: Jamal Carvalho <jamalcarvalho@google.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2021-12-21 14:25:10 +00:00
Jamal Carvalho d4a18cb3f6 cmd,internal: add ability to cache screenshots for an origin server
To speed up subsequent test runs or for use in CI testing
screenshots can be cached for an origin server by adding
the ::cache suffix to the URL.

For example, https://go.dev::cache.

Change-Id: I6ae6fd3f8f6f9fe884f74af6fb9ec7e6666e2f8b
Reviewed-on: https://go-review.googlesource.com/c/website/+/373477
Run-TryBot: Jamal Carvalho <jamal@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Trust: Jamal Carvalho <jamalcarvalho@google.com>
2021-12-21 00:00:05 +00:00
Jamal Carvalho dc95675888 internal/screentest: cleanup implementation
Updated the test reader to generate outfile paths
prior to test runs so that it is easier to read/write
to a cache of images in a future CL.

Change-Id: I3f27194c3fb7d215d5d258fe24da0b2b8ff53a5f
Reviewed-on: https://go-review.googlesource.com/c/website/+/373476
Run-TryBot: Jamal Carvalho <jamal@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Trust: Jamal Carvalho <jamalcarvalho@google.com>
2021-12-20 23:59:58 +00:00
Jamal Carvalho 4e7a786f45 internal/screentest: add package to compare screenshots web pages
As we clean up page styles post golang.org and go.dev merge,
and begin to implement the dark theme, we can use screenshot
testing to check that code changes don't result in unintended
style or html content changes.

Change-Id: Ia65f98f133df0f4a9fa3f382fd30c2455d65d73d
Reviewed-on: https://go-review.googlesource.com/c/website/+/371435
Run-TryBot: Jamal Carvalho <jamal@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Trust: Jonathan Amsterdam <jba@google.com>
Trust: Jamal Carvalho <jamalcarvalho@google.com>
2021-12-16 14:37:07 +00:00
Alexander Rakoczy ac8bdc32ee internal/history: document Go 1.17.5 and Go 1.16.12
Change-Id: I45e961be2b30f2193094bce2c6c2af78917a067d
Reviewed-on: https://go-review.googlesource.com/c/website/+/370594
Trust: Alex Rakoczy <alex@golang.org>
Run-TryBot: Alex Rakoczy <alex@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Filippo Valsorda <valsorda@google.com>
2021-12-09 13:35:49 +00:00
Dmitri Shuralyov 0dd6a27c6a internal/redirect: add special case for /issues/new for multiple templates
For golang/go#29839.

Change-Id: Ic6ff96d0d1321946df7f19a9f4af889e90255cb1
Reviewed-on: https://go-review.googlesource.com/c/website/+/369154
Trust: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
2021-12-06 22:18:50 +00:00
Russ Cox c4713138b0 _content: cancel spelling
canceled
canceling
cancellation

Per https://go.dev/wiki/Spelling.

Change-Id: I3e719a9f07e64259e6bcf02c9d15939069176538
Reviewed-on: https://go-review.googlesource.com/c/website/+/369714
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-12-06 20:47:26 +00:00
Michael Anthony Knyszek 9a694f2900 internal/history: document Go 1.17.4 and Go 1.16.11
Change-Id: Ie75a58e316eea0cc9777cadf72d50ff45f8ca0a7
Reviewed-on: https://go-review.googlesource.com/c/website/+/368734
Trust: Michael Knyszek <mknyszek@google.com>
Run-TryBot: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Website-Publish: Dmitri Shuralyov <dmitshur@google.com>
2021-12-02 23:40:00 +00:00
Russ Cox 7f5094fc5c cmd/golangorg: add support for multiple play backends
This lets people choose between the release version of Go (play.golang.org)
and the dev branch version (gotipplay.golang.org).
After CL 365854 goes live, it will offer Go 1.17, Go 1.16, and Go dev branch.

Change-Id: I7480a0cb4f1b09636f5728c41af507aac5a72026
Reviewed-on: https://go-review.googlesource.com/c/website/+/366056
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>
2021-11-30 18:10:09 +00:00
Russ Cox e0eb9bf3b1 tour: fix formatting endpoint
go.dev uses /_/fmt, not /fmt.
Fix the JavaScript and then the standalone tour binary to both use /_/fmt too.

Fixes golang/go#49746.

Change-Id: Ic59c6afb99748ed8c3e74c69c2d753671d92432b
Reviewed-on: https://go-review.googlesource.com/c/website/+/366977
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>
2021-11-25 00:26:26 +00:00
Russ Cox da1ce712a5 internal/backport/fmtsort: delete tests
There is something wrong with the tests, and we don't really need them.
This code was just copied from the main repo's internal/fmtsort in order
to support internal/backport/text/template. If the template tests are happy,
we are happy.

Fixes golang/go#49732.

Change-Id: I109e13e4ec7c40ab06d84cba05fcdcdf8ba0c8d9
Reviewed-on: https://go-review.googlesource.com/c/website/+/366954
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>
2021-11-24 22:58:50 +00:00
Russ Cox ad69553815 internal/tour: fix go.dev/tour
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>
2021-11-23 03:31:47 +00:00
Russ Cox c01d555894 talks: serve go.dev/talks for talks.golang.org content
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>
2021-11-22 20:36:15 +00:00
Russ Cox 91661c0642 internal/talks: copy golang.org/x/tools/cmd/present/dir.go
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>
2021-11-22 20:36:08 +00:00
Sean Liao c5047a94bc internal/blog: fix atom feed self link
Fixes golang/go#49595

Change-Id: Ie28221bf3dfe804ce3124040b15569a63ace56fa
Reviewed-on: https://go-review.googlesource.com/c/website/+/364275
Trust: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-11-22 17:28:07 +00:00
Russ Cox e77adb1f30 tour: serve from cmd/golangorg as go.dev/tour
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>
2021-11-22 16:43:07 +00:00
Russ Cox ab4f479b5c all: make golang.org and go.dev links relative
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>
2021-11-22 16:42:44 +00:00
Russ Cox cecdbb6e8e website: merge golang.org → go.dev
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>
2021-11-22 16:40:01 +00:00
Russ Cox 961523a997 go.dev: add /play
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>
2021-11-22 16:40:00 +00:00
Russ Cox b457dda264 internal/short: allow registering on a specific host
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>
2021-11-17 17:48:03 +00:00
Russ Cox 4209fd81f5 internal/dl: make download page testable offline
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>
2021-11-17 17:47:58 +00:00
Russ Cox 70e627117c cmd/golangorg: fix display of text files
Text files were being displayed raw, e.g.
https://golang.org/src/math/sin.go.
Fix that.

Change-Id: I09dec1d675ca950bf3750c38585cf3995a570134
Reviewed-on: https://go-review.googlesource.com/c/website/+/361206
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>
2021-11-06 12:24:47 +00:00
Than McIntosh c863a5098b internal/history: document Go 1.17.3 and Go 1.16.10
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>
2021-11-04 15:32:36 +00:00
Michael Anthony Knyszek 3b9afa944d internal/history: document Go 1.17.2 and Go 1.16.9
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>
2021-10-07 22:23:32 +00:00
Than McIntosh bd548c676d internal/history: document Go 1.17.1 and Go 1.16.8
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>
2021-09-09 18:03:44 +00:00
Dmitri Shuralyov 3bee3041b4 internal/dl: highlight Windows ARM64 installer
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>
2021-08-23 18:13:21 +00:00
Dmitri Shuralyov 0c7c710b59 internal/dl: change GOARCH=arm64 pretty string ARMv8 → ARM64
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>
2021-08-23 18:12:57 +00:00
Russ Cox 509175483b cmd/golangorg: use embedded content on App Engine
Change-Id: If211bdb2ba60fbb799cb4dfe67fd066094afc40f
Reviewed-on: https://go-review.googlesource.com/c/website/+/343936
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
2021-08-23 15:30:36 +00:00
Russ Cox a3cb3101ad all: delete unmodified Go 1.16 backports
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>
2021-08-23 15:30:31 +00:00
Dmitri Shuralyov 06c346b9b6 internal/dl: update minimum macOS version to 10.13
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.
Fixes golang/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>
2021-08-23 14:12:00 +00:00
Russ Cox 45603b6afa internal/redirect: gofmt
Change-Id: If4bbcc78c0c1aa35531ceacd43399f52bc1a0174
Reviewed-on: https://go-review.googlesource.com/c/website/+/343938
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
2021-08-20 20:20:31 +00:00
Russ Cox a32a1a4724 cmd/golangorg: fix blog feed on home page
New jsonp handler was buggy,
and unclear whether redirects are followed.

Change-Id: Ib1e85aa879018cb8e0da664ec47b10dfcda049c5
Reviewed-on: https://go-review.googlesource.com/c/website/+/343410
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-08-18 23:01:08 +00:00
Russ Cox b110cf7979 cmd/golangorg: add blog to valid hosts
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>
2021-08-18 20:07:38 +00:00
Russ Cox 6c6d3e7c40 cmd/golangorg: move blog from blog.golang.org to go.dev/blog
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>
2021-08-18 19:48:35 +00:00
Russ Cox 68b6eba5d5 cmd/golangorg: fix regexp match with ^ and $
Also fix doc/articles/wiki code file references.

Fixes golang/go#47759.

Change-Id: Idd0cce627f594898c805269ae7cd0e0f980aec8f
Reviewed-on: https://go-review.googlesource.com/c/website/+/343289
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>
Website-Publish: Russ Cox <rsc@golang.org>
2021-08-18 16:21:07 +00:00
Russ Cox 2bccad4564 cmd/golangorg: fix golang.google.cn/dl
Fixes golang/go#47750.

Change-Id: I1816df0dbd629705118b6f5b23c264efab73b04b
Reviewed-on: https://go-review.googlesource.com/c/website/+/343009
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>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Website-Publish: Russ Cox <rsc@golang.org>
2021-08-17 18:22:03 +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 f8f1822414 internal/web: move SrcBreadcrumb SrcPkgLink, invoke into templates
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>
2021-08-17 13:59:33 +00:00
Russ Cox 5a3d51791d internal/tmplfunc: mv go.dev/cmd/internal/tmplfunc up a few levels
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>
2021-08-17 13:59:29 +00:00
Michael Anthony Knyszek cb7929b9fd internal/history: add Go 1.17
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>
2021-08-16 18:33:20 +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
Russ Cox f524297668 internal/gitfs: add git-backed FS implementation
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>
2021-08-12 13:25:57 +00:00
Alexander Rakoczy fb30ab730d internal/history: document Go 1.16.7 and Go 1.15.15
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>
2021-08-05 17:00:27 +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
Dmitri Shuralyov 8557135a89 internal/history: document Go 1.16.6 and Go 1.15.14
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>
2021-07-12 22:28:50 +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
Than McIntosh 6a50fde3fa internal/dl: add thanm to validUser
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>
2021-07-01 13:29:39 +00:00
Russ Cox a430a3f526 internal/web: pre-expand tabs in markdown
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>
2021-06-28 13:50:53 +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 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 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 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 35beb4cf86 internal/backport: add backports of current Go dev template, fs packages
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>
2021-06-15 02:35:47 +00:00
Russ Cox e5882a3721 internal/webtest: add package for testing web servers
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>
2021-06-15 02:12:39 +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 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 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
Heschi Kreinick dd8acb4c96 internal/dl: add heschi to validUser
Change-Id: I9db12489e940dcc7444801f9337e1564bab382d4
Reviewed-on: https://go-review.googlesource.com/c/website/+/326569
Trust: Heschi Kreinick <heschi@google.com>
Run-TryBot: Heschi Kreinick <heschi@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-06-09 22:48:07 +00:00
Russ Cox 9d7d9c7a5d all: remove ?m=src
Instead of /pkg/fmt/?m=src people can use /src/pkg/fmt/.

Change-Id: I77dd11dcfa1b3e8d660e9cda6a5f07dbb60d721b
Reviewed-on: https://go-review.googlesource.com/c/website/+/317654
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-08 20:20:20 +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
David Chase 9478f6c83f internal/history: document Go 1.16.5 and Go 1.15.13
Second security+dot release, another custom summary.

Change-Id: Ic36179259896f06cdbe7958f8d45628dc41f2ac3
Reviewed-on: https://go-review.googlesource.com/c/website/+/324772
Trust: David Chase <drchase@google.com>
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Carlos Amedee <carlos@golang.org>
2021-06-03 20:40:35 +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
Heschi Kreinick c1bd207ca8 cmd/golangorg,internal/history: document Go 1.16.4 and Go 1.15.12
1.16.4 and 1.15.12 are our first releases containing public security
fixes. As such, the existing template doesn't work well for them, so use
a CustomSummary.

Change-Id: Ib70990425b1a2963030b1034295a20b4c105c630
Reviewed-on: https://go-review.googlesource.com/c/website/+/317609
Trust: Heschi Kreinick <heschi@google.com>
Trust: Carlos Amedee <carlos@golang.org>
Run-TryBot: Heschi Kreinick <heschi@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Carlos Amedee <carlos@golang.org>
2021-05-06 18:38:36 +00:00
yangwenmai 61aee95efe internal/dl: simplify featured macOS file regexp
The current macOS release filenames no longer include a "-osx10.8"
suffix, so the featured file regexp can made shorter and simpler.

Change-Id: Ia6a1b58e20909ba9485e02b51ee4b0297f6ff20e
Reviewed-on: https://go-review.googlesource.com/c/website/+/293589
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Cherry Zhang <cherryyz@google.com>
2021-04-30 16:32:06 +00:00
Yu, Li-Yu 1eaa20f5b9 internal/pkgdoc: fix synopsis pkg name == dir name matching
file.Name.Name should match the directory name not the filename.

In CL 296378, newDirTree's name parameter was removed and synopsis
matched against the filename of the source code, e.g. "*.go".

Fixes golang/go#45042
Fixes golang/go#45614

Change-Id: Ifa4c8a70429e277efb1f9f726de9249509cbcee0
Reviewed-on: https://go-review.googlesource.com/c/website/+/311089
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Cherry Zhang <cherryyz@google.com>
2021-04-26 16:24:13 +00:00
Sean Liao 97803416bb internal/dl: include old unstable release in archive
Updates golang/go#17574
Fixes golang/go#37581
Fixes golang/go#43975

Change-Id: I31cab4b8f8277b3c83ddde001f2649bb5f0bc9c7
Reviewed-on: https://go-review.googlesource.com/c/website/+/290310
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Trust: Carlos Amedee <carlos@golang.org>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
2021-04-05 21:38:05 +00:00
Carlos Amedee a49366dd89 internal/dl: remove unlikely releasers from validUser
This change removes adg, bradfitz, cbro, andybons and julieqiu from
the list of valid users. They are not expected to be releasing Go at
any point in the near future.

Change-Id: I38fd878f4c9487402ad61bab8b3d8c6437dd9763
Reviewed-on: https://go-review.googlesource.com/c/website/+/305689
Trust: Carlos Amedee <carlos@golang.org>
Run-TryBot: Carlos Amedee <carlos@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-04-02 18:39:17 +00:00
Dmitri Shuralyov 363b0256a3 internal/history: document Go 1.16.3 and Go 1.15.11
For golang/go#45334.
For golang/go#45333.

Change-Id: I7928cf48bad658ca7dd391b84802e0c8bb788617
Reviewed-on: https://go-review.googlesource.com/c/website/+/306670
Trust: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
2021-04-01 21:26:54 +00:00
Carlos Amedee ae515ad5b7 internal/dl: add cherryyz, drchase and mknyszek to validUser
Change-Id: I22025263b8d33e236671748fad9ef46ebc4441d1
Reviewed-on: https://go-review.googlesource.com/c/website/+/305531
Trust: Carlos Amedee <carlos@golang.org>
Run-TryBot: Carlos Amedee <carlos@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-03-29 18:21:25 +00:00
Alberto Donizetti 5c0ab37769 internal/dl: fix links to module proxy configuration
The downloads page has a link pointing to a section about module proxy
servers in the cmd/go doc that was removed in CL 282615. Remove the
anchor.

Fixes golang/go#44780

Change-Id: Ifb7f4f991b3314a3cda6d00d77925401a8830456
Reviewed-on: https://go-review.googlesource.com/c/website/+/299129
Trust: Alberto Donizetti <alb.donizetti@gmail.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-03-18 09:49:56 +00:00
Russ Cox 7fe51e8c4a internal/godoc: split package docs into new package pkgdoc [generated]
Isolate package docs scanning and extraction into a new package.
Generated by script below.

[git-generate]
cd internal/godoc
rf '
	# We want to end up with each package having its own toFS,
	# but to keep each step leaving a valid package, export toFS as ToFSPath
	# so it can be used as pkgdoc.ToFSPath after the move.
	# We will rewrite the uses left behind after the move.
	mv toFS ToFSPath

	mv newDirTree newDir
	mv Directory Dir
	mv Dir.listing Dir.List
	mv Dir.lookup Dir.Lookup
	mv \
		ToFSPath \
		Dir \
		Dir.Name \
		DirList \
		DirEntry \
		DirEntry.Name \
		Dir.Lookup \
		Dir.List \
		newDir \
		isPkgFile \
		isPkgDir \
		Dir.walk \
		walkDirs \
		parseFile \
		parseFiles \
		linePrefix \
		replaceLinePrefixCommentsWithBlankLine \
		dir.go

	mv stripExampleSuffix TrimExampleSuffix
	mv splitExampleName SplitExampleName
	mv poorMansImporter simpleImporter

	mv dirtrees_test.go dir_test.go

	mv \
		DocTree \
		NewDocTree \
		PageInfo \
		PageInfo.IsEmpty \
		PageInfoMode \
		NoFiltering \
		modeNames \
		PageInfoMode.String \
		GetPageInfoMode \
		DocTree.GetPageInfo \
		DocTree.includePath \
		simpleImporter \
		packageExports \
		funcsByName \
		funcsByName.Len \
		funcsByName.Swap \
		funcsByName.Less \
		collectExamples \
		globalNames \
		addNames \
		SplitExampleName \
		TrimExampleSuffix \
		startsWithUppercase \
		doc.go

	mv \
		TestIgnoredGoFiles \
		TestIssue5247 \
		doc_test.go

	mv dir.go dir_test.go doc.go doc_test.go golang.org/x/website/internal/pkgdoc

	# Add a new toFS and rewrite the uses left behind.
	add server.go:/^\)/ \
		// toFS returns the io/fs name for path (no leading slash). \
		func toFS(name string) string { \
			if name == "/" { \
				return "." \
			} \
			return path.Clean(strings.TrimPrefix(name, "/")) \
		}

	ex {
		import "golang.org/x/website/internal/pkgdoc"
		var x string
		pkgdoc.ToFSPath(x) -> toFS(x)
	}
'
rm dirtrees.go parser.go
cd ../pkgdoc
rf '
	# Finish toFS split
	mv ToFSPath toFS

	# Clean up API for package pkgdoc
	mv PageInfo Page
	mv DocTree.GetPageInfo Doc.Page

	mv DocTree Docs
	mv NewDocTree NewDocs

	mv PageInfoMode Mode
	mv GetPageInfoMode ParseMode
	mv NoFiltering ModeAll
	mv FlatDir ModeFlat
	mv AllMethods ModeMethods
	mv ShowSource ModeSrc
	mv NoTypeAssoc ModeBuiltin
'

Change-Id: I24384f40739af286c528beb06aa153843005a870
Reviewed-on: https://go-review.googlesource.com/c/website/+/296380
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:10 +00:00
Russ Cox a4e42960dc internal/godoc: remove pathpkg renaming
This makes various other code movement a bit nicer.

Change-Id: I89c46dcbf3019eead4922f4db301bf0ea82b697e
Reviewed-on: https://go-review.googlesource.com/c/website/+/296379
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:08 +00:00
Russ Cox a3455e4f5b internal/godoc: simplify, isolate pkg docs tree code
- IsGOROOT is always true (the only docs we serve)
- SummarizePackage is unused
- newDirectory is only called on the root with unlimited depth
- Name is redundant with Path
- Directory.Depth is unused
- only DirEntry is assigned to dirEntryOrFileInfo
- parallel walk is only needed for huge trees (GOROOT is not)
- separate entirely from Corpus
- pull new DocTree out of handlerServer

This will let us better separate the package doc tree from HTTP service
and from the general document server.

Change-Id: Iac667a0ff624306cdd535a33dd22dcb04062b46c
Reviewed-on: https://go-review.googlesource.com/c/website/+/296378
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:07 +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 f46db3cc1a internal/godoc: split out API version database [generated]
Extract API database into a standalone package.
Generated with rf script below.

[git-generate]
cd internal/godoc
rf '
	mv apiVersions DB
	mv DB.sinceVersionFunc DB.Func
	mv pkgAPIVersions PkgDB
	mv PkgDB.typeSince PkgDB.Type
	mv PkgDB.methodSince PkgDB.Method
	mv PkgDB.funcSince PkgDB.Func
	mv PkgDB.fieldSince PkgDB.Field
	mv parsePackageAPIInfo Load
	mv versionedRow row
	mv versionParser dbParser

	mv DB PkgDB \
		DB.Func \
		Load \
		dbParser \
		dbParser.parseFile \
		row \
		parseRow \
		api.go

	mv versions_test.go api_test.go

	mv api.go api_test.go golang.org/x/website/internal/api
'
cd ../api
rf '
	mv dbParser parser
'

Change-Id: I1bf57608345ae39eb217024c9c4bf1ae6543bd98
Reviewed-on: https://go-review.googlesource.com/c/website/+/296376
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:05 +00:00
Russ Cox 4e76d9d0e0 internal/godoc: factor out example, ast support funcs
Moved with

rf '
	mv \
		Presentation.example_htmlFunc \
		replaceLeadingIndentation \
		exampleOutputRx \
		filterOutBuildAnnotations \
		Presentation.example_nameFunc \
		Presentation.example_suffixFunc \
		splitExampleName \
		stripExampleSuffix \
		startsWithUppercase \
		examplefuncs.go

	mv \
		slashSlash \
		Presentation.nodeFunc \
		Presentation.node_htmlFunc \
		Presentation.writeNode \
		firstIdent \
		comment_htmlFunc \
		sanitizeFunc \
		astfuncs.go
	rm Presentation.WriteNode

'

plus deleting the doc comments and import path comments,
which didn't move well.

Change-Id: I71b1dd58527938cafccfc901a0dadcc6dff34664
Reviewed-on: https://go-review.googlesource.com/c/website/+/296375
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:03 +00:00
Russ Cox 28d7606f40 internal/godoc: introduce TabSpacer
Mainly just isolate it from Presentation, but give it a nice API too.

Change-Id: I9650bf650a15bfd814fe4da58de6fa133a858d90
Reviewed-on: https://go-review.googlesource.com/c/website/+/296374
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:02 +00:00
Russ Cox d72b0a78e3 internal/godoc: split spec markup into internal/spec
Change-Id: Ife4429f4c75a50fdd1caae72db5cdb0d876e78e6
Reviewed-on: https://go-review.googlesource.com/c/website/+/295410
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:01 +00:00
Russ Cox 4eb9b856a3 internal/godoc: split text formatting into internal/texthtml
Change-Id: Iaef43e66c32dbeb7c3fc3a4a769112d153c57ce1
Reviewed-on: https://go-review.googlesource.com/c/website/+/295409
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:00 +00:00
Russ Cox 2d643c47ce internal/godoc/golangorgenv: delete
Now that all the references are internal
(the direct playground reference is gone),
we can use internal/env instead.

Change-Id: I10d323a5e08bee153bd921cffe79fb4eb9e8b29c
Reviewed-on: https://go-review.googlesource.com/c/website/+/293426
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:59 +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
Carlos Amedee b24263deb8 internal/history: document Go 1.16.2 and Go 1.15.10
Updates golang/go#44943
Updates golang/go#44944

Change-Id: Ic8391e46d039ece835791ad0a13a5ccfa41ff7e5
Reviewed-on: https://go-review.googlesource.com/c/website/+/301009
Trust: Carlos Amedee <carlos@golang.org>
Run-TryBot: Carlos Amedee <carlos@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Jeremy Faller <jeremy@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-03-11 19:47:19 +00:00
Filippo Valsorda 0fbcfa0516 internal/history: document Go 1.16.1 and Go 1.15.9
Change-Id: I74784f4520661b580741ee3219a776cc17d6effd
Reviewed-on: https://go-review.googlesource.com/c/website/+/300589
Trust: Filippo Valsorda <filippo@golang.org>
Run-TryBot: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Alexander Rakoczy <alex@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
2021-03-10 21:26:05 +00:00
Michael Pratt 7e301e09e5 internal/redirect: bump bigEnoughAssumeRietveld
Gerrit CL numbers now exceed 300k, so new CL numbers are landing on the
Gerrit/Rietveld disambiguation page.

Bump bigEnoughAssumeRietveld to 4M (approximately the max before we need
to handle subrepos) and update the table. Now we won't need to deal with
this again for quite a while.

Change-Id: I6ddd8cdd19012f0b58e39c2df76ff23f376c2f1b
Reviewed-on: https://go-review.googlesource.com/c/website/+/300089
Trust: Michael Pratt <mpratt@google.com>
Run-TryBot: Michael Pratt <mpratt@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
2021-03-09 18:38:05 +00:00
Dmitri Shuralyov a95e02bdd7 internal/history: document upcoming Go 1.16.1 and 1.15.9 security releases
They have been pre-announced¹.

¹ https://groups.google.com/g/golang-announce/c/UERZo89zw8o

Change-Id: Ief02b0a7ced6b69a2aef7b1b0cf288b8df7116f8
Reviewed-on: https://go-review.googlesource.com/c/website/+/299270
Trust: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Katie Hockman <katie@golang.org>
2021-03-05 23:19:41 +00:00
Russ Cox 7118d0ea1d cmd/golangorg: clean up directory listings
The time stamps are unlikely to be useful or correct.
Today golang.org shows the release time for all files,
which has zero information content. Drop them.

Do not show size for directories - it's meaningless.

Show all directories before all files for easier navigation
and to keep package sources listed more compactly.

Change-Id: I06247988003e310aa19ecec7399b94f315e323bd
Reviewed-on: https://go-review.googlesource.com/c/website/+/293495
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-02-24 17:36:25 +00:00
Russ Cox 6a70b35e83 internal/godoc/util: merge into internal/godoc
Only used by godoc, so just move the utility code into the main package.
Down to a single directory.

Change-Id: I1bef28ce932372d748dd062eb6597d8979a26b08
Reviewed-on: https://go-review.googlesource.com/c/website/+/293491
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-02-24 17:36:18 +00:00
Russ Cox 9c12cfa1fe internal/godoc: remove vfs
Change-Id: I508d92508553be76e42b4066e540c146e1c9ba53
Reviewed-on: https://go-review.googlesource.com/c/website/+/293490
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-02-24 17:36:13 +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 b20f6e4e47 internal/godoc: delete RootType
We no longer use GOPATH at all, so all that matters is whether
the directory is GOROOT or not. We don't need the file system
to tell us - we can check whether a known file exists, like
src/math/abs.go.

Change-Id: I9d4efb9d0d3882a4875aa7176ce21ed24ede3f4d
Reviewed-on: https://go-review.googlesource.com/c/website/+/293428
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-02-24 17:36:03 +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 d6a1a7b134 internal/redirect: add minor fixes from golang.org/x/tools/godoc/redirect
Change-Id: I7436b87c2fd952ad71f25affaf74944b6ec51e6f
Reviewed-on: https://go-review.googlesource.com/c/website/+/293425
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-02-24 17:35:54 +00:00
Russ Cox 5bbf007a6d internal/godoc/redirect: remove unused package
Change-Id: I671c64ff191520395bb68430a51dab73cc9e0a30
Reviewed-on: https://go-review.googlesource.com/c/website/+/293424
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-02-24 17:35:49 +00:00
Russ Cox e2e5d76fea internal/godoc: remove analysis
We have never run this code on golang.org.

Change-Id: Iba632f00ea055308c036f389e3af56ab11781832
Reviewed-on: https://go-review.googlesource.com/c/website/+/293423
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-02-24 17:35:44 +00:00
Russ Cox 79dd487121 internal/godoc/static: delete unused package
Change-Id: I6427b5030e2d4a56b1e6d9075ca3c94ec3dd802c
Reviewed-on: https://go-review.googlesource.com/c/website/+/293422
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-02-24 17:35:39 +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 6cf1d5f27d internal/godoc: fork golang.org/x/tools/godoc@123adc86bc
This is a straight copy of golang.org/x/tools/godoc@123adc86bc
(CL 291669) with internal import paths updated, gofmt run,
and go17_test.go folded into godoc_test.go (we are well past Go 1.7 now).

The next CL will change cmd/golangorg to use it, and then
we can start making adjustments to delete lots of unused code,
without worrying about affecting any external importers of
the original.

This CL brings in 16,290 lines of code, but less than 2,000
will actually remain once all the no-longer-needed code is
deleted in followup CLs.

Change-Id: I40ff57fe610b252df8bd6bb5de1114cdd7a750a2
Reviewed-on: https://go-review.googlesource.com/c/website/+/293420
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-02-24 17:35:29 +00:00
Russ Cox de781e571e _content: delete search box from home page
The search feature is not used much and does not give terribly useful answers.
It accounts for under 2% of golang.org traffic and about one real query per minute.

Looking through a log of 1,592 search queries over a 28-hour period last week,
almost all of them would have found better answers using Google or pkg.go.dev.

Just a few examples of queries for which we had no good answers:

 - 1.16
 - 1.16beta
 - GOPATH
 - k8s.io/api/settings/v1alpha1
 - language and capacity
 - linux installation
 - logical operators
 - mocking struct
 - naming convention
 - remove element from slice
 - sirupsen/logrus
 - string template
 - struct field tag
 - tutorial
 - update go
 - using go modules
 - visual studio code

Removing the search box on the main site will stop acting as though it gives
useful information for queries like these. Then hopefully people will find their
way to Google or pkg.go.dev instead.

Fixes #44357.

Change-Id: I400157e478a9faaf35c3fdb60380336ee0b135a3
Reviewed-on: https://go-review.googlesource.com/c/website/+/292590
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-18 03:22:27 +00:00
Alexander Rakoczy baa8c5f593 internal/history: document Go 1.16
Change-Id: Ieb559df248ea4c7bdf23ef199e0520caf06a6de2
Reviewed-on: https://go-review.googlesource.com/c/website/+/292591
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>
Reviewed-by: Carlos Amedee <carlos@golang.org>
2021-02-16 19:29:53 +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
Carlos Amedee 7fa68de391 internal/history: document Go 1.15.8 and Go 1.14.15
Updates golang/go#44105
Updates golang/go#44104

Change-Id: I4a870f91e24fac060f14f7798bd53706a9108ebe
Reviewed-on: https://go-review.googlesource.com/c/website/+/289702
Trust: Carlos Amedee <carlos@golang.org>
Run-TryBot: Carlos Amedee <carlos@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Alexander Rakoczy <alex@golang.org>
2021-02-04 22:27:25 +00:00
Jamal Carvalho 0c2f86a568 content,internal: move HaTS trigger to download doc pages
Moves the HaTS trigger to the install doc pages so
that surveys will prompt while file downloads are
in progress.

Change-Id: I9437909c96907740fa21a0176d86b6adfe45d574
Reviewed-on: https://go-review.googlesource.com/c/website/+/286775
Reviewed-by: Alexander Rakoczy <alex@golang.org>
Trust: Jamal Carvalho <jamal@golang.org>
2021-01-27 16:46:14 +00:00
Jamal Carvalho 1007538d29 internal/dl: add HaTS to golang.org downloads page
Adds a script to trigger HaTS on the download page in an
effort to track developer happiness with the core Go
distribution. Uses the same bucketing and rate limiting
logic as go.dev and pkg.go.dev.

Change-Id: I73cdb4577eaf71a77f09b94965e12871296a6699
Reviewed-on: https://go-review.googlesource.com/c/website/+/286293
Trust: Jamal Carvalho <jamal@golang.org>
Run-TryBot: Jamal Carvalho <jamal@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
2021-01-25 20:53:07 +00:00
Roland Shoemaker d4a1d39661 internal/history: document Go 1.15.7 and Go 1.14.14
Change-Id: I1bbd0808fc43479a9fd84cc8e61dd8163aec96cf
Reviewed-on: https://go-review.googlesource.com/c/website/+/284872
Trust: Roland Shoemaker <roland@golang.org>
Run-TryBot: Roland Shoemaker <roland@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-01-20 15:50:25 +00:00
Roland Shoemaker c818595f3d internal/history: document upcoming Go 1.15.7 and 1.14.14 security releases
They have been pre-announced¹.

¹ https://groups.google.com/g/golang-announce/c/KvrRblbXp_w

Change-Id: I6c55559a8598b8417f92bc1e8c69fd974270f462
Reviewed-on: https://go-review.googlesource.com/c/website/+/283536
Run-TryBot: Roland Shoemaker <roland@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Roland Shoemaker <roland@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-01-13 19:40:17 +00:00
Dmitri Shuralyov 8d60aee9a6 internal/dl: categorize new darwin/arm64 binaries better
We want the new darwin/arm64 installer and archive to be placed next
to the original darwin/amd64 files, not under "Other Ports". Also
highlight (make bold) the darwin/arm64 installer (but not archive).

The "pretty" version of the architecture will be displayed as "ARMv8",
and maybe should be made more macOS-specific in the future.

Updates golang/go#42756.

Change-Id: I5e95a3b93d30253d8fa291d153b3f96f49f9ab5d
Reviewed-on: https://go-review.googlesource.com/c/website/+/278787
Trust: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Alexander Rakoczy <alex@golang.org>
2020-12-17 18:14:27 +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
Carlos Amedee 4b0d7aebbb internal/history: document Go 1.15.6 and Go 1.14.13
Updates golang/go#42973
Updates golang/go#42974

Change-Id: I3c6f12238e7b36a079d399f45c0974512badf6a4
Reviewed-on: https://go-review.googlesource.com/c/website/+/275116
Trust: Carlos Amedee <carlos@golang.org>
Run-TryBot: Carlos Amedee <carlos@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2020-12-03 20:45:47 +00:00