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

28 Коммитов

Автор SHA1 Сообщение Дата
Thiago aabfe331f9 tour: add a Spanish translation
I'm part of the Gophers-Latam Community. I am excited to present our
translation of the Tour of Go, a collaborative effort of our community.
It's available at https://go-tour-lat.appspot.com/.

Fixes golang/go#64454

Change-Id: Icd6e1f8ec340deea992858571c03bc2ae933d72b
GitHub-Last-Rev: 45234eb657
GitHub-Pull-Request: golang/website#264
Reviewed-on: https://go-review.googlesource.com/c/website/+/545855
Reviewed-by: Thiago Mowszet <thiagomowszet@gmail.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
2024-07-31 14:59:01 +00:00
Oleksandr Redko 97c56edbf3 _content/tour: change '// +build' to '//go:build'
Rename no-build to nobuild, no-run to norun because it's forbidden
to use hyphen in a build constraint name.

Change-Id: Ide0cd3c72f6c79c640b601c0526e08223de04610
Reviewed-on: https://go-review.googlesource.com/c/website/+/594815
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Than McIntosh <thanm@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
2024-07-01 13:45:53 +00:00
Oleksandr Redko 8d335a83f6 _content/tour: fix content test
- Add missing '// +build' comments for generics examples.
- Add build tags 'OMIT', 'no-run' for solutions examples.
- Move content_test.go to the root because 'go' ignores
packages in the '_content' directory.
- Remove usages of deprecated 'io/ioutil'.

Change-Id: I8e6b717d43df9e2b55e4b796db5b316860f42103
Reviewed-on: https://go-review.googlesource.com/c/website/+/592875
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
2024-06-21 18:48:12 +00:00
Valentin Deleplace a84f6ee550 tour: call 'done' callback after Run, on message Kind 'system'
To restore the button Run and hide the button Kill (in A Tour of Go,
not in the main Playground), writeInterceptor is expecting a call of
Kind 'end'. However, on compilation error the last call emitted has
Kind 'system'.

Fixes golang/go#50921

Change-Id: I698331e477e79fef368550d5976b5b2fc0b03e83
Reviewed-on: https://go-review.googlesource.com/c/website/+/478415
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Eno Compton <enocom@google.com>
Auto-Submit: Carlos Amedee <carlos@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2024-01-19 15:36:06 +00:00
Russ Cox 0a7f378581 cmd/golangorg: check for invalid or broken links in served HTML
Test that links are to /foo not https://go.dev/foo
and also check that the links actually point at real pages.
Manually fix problems that the test found.

For golang/go#37047.

Change-Id: I825eec3c2cadb9d259caff51cd893f3023ab533a
Reviewed-on: https://go-review.googlesource.com/c/website/+/548059
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Russ Cox <rsc@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2023-12-08 03:23:52 +00:00
Alexander Yastrebov 9817d4fb13 _content/tour: add dark theme cursor and selection styles
Add styles for dark theme cursor and selection.
Cursor color set equal to the foreground color.
Focused selection color set to the complement color
of the background color and inactive selection
is the lighter tint of it.

Fixes golang/go#63313

Change-Id: If9702f45262eea330d42ec0fd9717b36da026540
GitHub-Last-Rev: 1545bbaea9
GitHub-Pull-Request: golang/website#253
Reviewed-on: https://go-review.googlesource.com/c/website/+/531856
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Suzy Mueller <suzmue@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Reviewed-by: Suzy Mueller <suzmue@golang.org>
2023-10-05 22:11:16 +00:00
Suzy Mueller f8747b4bbb _content/tour: improve color contrast for dark theme
Updated the color to improve the color contrast when using dark
mode. More or less tried to pick a lighter color of the light
mode color.

Color contrast changes:
- cm.atom: 1.02 -> 6.26
- cm.comment: 2.42 -> 7.6

Fixes golang/go#63229

Change-Id: Ie6257b71d32d8cccf11025e74108e80ae4f9b36d
Reviewed-on: https://go-review.googlesource.com/c/website/+/531215
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
2023-09-26 18:14:53 +00:00
Hana (Hyang-Ah) Kim 9a8a0a0046 _content/tour/static/js: fix type errors
script.js:694 TypeError: elm.draggable is not a function
    at http://127.0.0.1:3999/tour/script.js:10589:17
    at j (http://127.0.0.1:3999/tour/script.js:675:458)
    at e (http://127.0.0.1:3999/tour/script.js:671:248)
    at e (http://127.0.0.1:3999/tour/script.js:671:265)
    at j (http://127.0.0.1:3999/tour/script.js:675:398)
    at e (http://127.0.0.1:3999/tour/script.js:671:248)
    at http://127.0.0.1:3999/tour/script.js:670:312
    at k (http://127.0.0.1:3999/tour/script.js:782:156)
    at Object.$broadcast (http://127.0.0.1:3999/tour/script.js:722:240)
    at http://127.0.0.1:3999/tour/script.js:714:191 <div vertical-slide="" left="#left-side" right="#right-side">

_content/tour/static/partials/editor.html and _content/tour/static/css
use 'vertical-slide' and 'horizontal-slide'.
I don't know why go.dev does not report these errors.

Change-Id: I9e0f5bb2540af8e642281d7c350f57b69195624a
Reviewed-on: https://go-review.googlesource.com/c/website/+/527080
Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com>
Reviewed-by: Russ Cox <rsc@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
2023-09-12 19:08:11 +00:00
Hana (Hyang-Ah) Kim bc602d6062 _content/tour/static/lib: sync jquery@3.7.0 jquery-ui@1.13.2
curl https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js > jquery.min.js
curl https://ajax.googleapis.com/ajax/libs/jqueryui/1.13.2/jquery-ui.min.js > jquery-ui.min.js

Change-Id: I50d2d5aa5eceaf32ecd27abcd1c4a44be6d305d8
Reviewed-on: https://go-review.googlesource.com/c/website/+/527079
Reviewed-by: Russ Cox <rsc@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com>
2023-09-12 18:54:39 +00:00
Deleplace 6fcd42d2ce _content: apply white color in transparent gopher, for dark theme.
Fixes golang/go#62316

Change-Id: I5bda00629a5de3e3266911c0c518b6c2078e4b97
Reviewed-on: https://go-review.googlesource.com/c/website/+/523415
Run-TryBot: Jamal Carvalho <jamal@golang.org>
Auto-Submit: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
2023-08-28 15:17:07 +00:00
luisglopez7777 80138e489b _content: add dark mode to go.dev/tour
Change-Id: I8fe87632b3f863fc80290537a428c884a232f280
Reviewed-on: https://go-review.googlesource.com/c/website/+/509116
Reviewed-by: Robert Findley <rfindley@google.com>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
Run-TryBot: Jamal Carvalho <jamal@golang.org>
Auto-Submit: Jamal Carvalho <jamal@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
2023-08-03 13:41:10 +00:00
Viktor 53bf622d51 _content/tour: add a link to the Ukraininan translation
Add a link to the Ukrainian translation to "A Tour of Go".

Link: https://go-tour-ua-translation.lm.r.appspot.com

Fixes golang/go#59945.

Change-Id: I688c6d89914e8bcce4b71a9eb381fe3c196776bd
GitHub-Last-Rev: 1d5608cb80
GitHub-Pull-Request: golang/website#224
Reviewed-on: https://go-review.googlesource.com/c/website/+/492215
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@google.com>
Run-TryBot: Dmitri Shuralyov <dmitshur@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
2023-05-15 17:42:03 +00:00
Jamal Carvalho 41e922072f _content/tour: fix top-left link to homepage
Fixes golang/go#59094.

Change-Id: I240bb8abfd663f5e5dea687d28c1b1c5d4b58980
Reviewed-on: https://go-review.googlesource.com/c/website/+/481675
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Jamal Carvalho <jamal@golang.org>
Auto-Submit: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Suzy Mueller <suzmue@golang.org>
2023-04-05 16:34:43 +00:00
Valentin Deleplace b0bb140f79 _content: add high-res favicon
Fixes golang/go#57899

Change-Id: I66d6477f7d595229443b45230202957193114047
Reviewed-on: https://go-review.googlesource.com/c/website/+/476975
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
2023-03-16 15:58:34 +00:00
Daniel Frederick Crisman 8bb4a56901 tour: added missing word "methods"
Missing word "methods" in fourth paragraph of screen "Choosing a value or pointer receiver".  Reads more clearly when what is being talked about is identified.

Fixes golang/tour#1352

Change-Id: I569f7ceed2e732c9e0485270828dcab387f86c71
GitHub-Last-Rev: b086ba8212
GitHub-Pull-Request: golang/website#197
Reviewed-on: https://go-review.googlesource.com/c/website/+/471315
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
2023-02-27 11:50:42 +00:00
Daniel Frederick Crisman 2e65c647b0 tour: no deterministic note as 1.20 does rand seed
With go 1.20 "math/rand package now automatically seeds the global random number generator" (https://go.dev/doc/go1.20#math/rand) and we do not need the appengine specific note that the Go Playground environment for the tour programs is deterministic.

As the note is specific to the appengine version (i.e. it is already not shown in the Go offline tour) it should be fine to just remove the text.

Fixes golang/tour#1448

Change-Id: Ice84497dbe95c5e3e89fec2d44d4cb74bc2dd5be
GitHub-Last-Rev: b27bc7bf12
GitHub-Pull-Request: golang/website#194
Reviewed-on: https://go-review.googlesource.com/c/website/+/469575
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
2023-02-22 16:47:37 +00:00
Frederick Mixell 9abce52941 _content: Docs - linking update
- updates some links that were pointing to /dl to /doc/install
- Add "About Go Packages" link to the footer nav under "Packages"

Video: https://drive.google.com/file/d/1hAxhpJpHsAnHf5ww267IK6ovWnL-S1dG/view?usp=sharing

Change-Id: I0d71b095a6a60b809a5bceff9cc5fe4a38d5eb91
Reviewed-on: https://go-review.googlesource.com/c/website/+/449415
Reviewed-by: Jamal Carvalho <jamal@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Jamal Carvalho <jamal@golang.org>
Auto-Submit: Jamal Carvalho <jamal@golang.org>
Reviewed-by: David Chase <drchase@google.com>
2023-01-30 14:28:10 +00:00
Frederik Zipp 4056b246ea all: fix a lot of typos
Change-Id: I0754d18f4c3c3d5dfa0c34b4bc154a35ac20b917
Reviewed-on: https://go-review.googlesource.com/c/website/+/411794
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
2022-06-15 16:32:49 +00:00
Eno Compton 7cb1456a37 tour: correct typo
Change-Id: I14f0317c1f6c36aa922c43eab45a7bc4dd698142
Reviewed-on: https://go-review.googlesource.com/c/website/+/394314
Reviewed-by: Eli Bendersky‎ <eliben@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Run-TryBot: Eli Bendersky‎ <eliben@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Trust: Eli Bendersky <eliben@google.com>
2022-03-21 19:55:56 +00:00
Eli Bendersky b970f4b5b0 tour: add a basic explanation and examples of generics to the Tour of Go
Change-Id: Iad4a0bf762b023b14d3f9c532da31674fcca804c
Reviewed-on: https://go-review.googlesource.com/c/website/+/370174
Reviewed-by: DO NOT USE <iant@google.com>
Trust: Cherry Mui <cherryyz@google.com>
2022-03-15 17:46:42 +00:00
Russ Cox f81f4f7f21 _content: remove some https://go.dev/ prefixes in links
The site is served at both go.dev and golang.google.cn.
In China, only golang.google.cn can serve, so we try to use
relative links to avoid pointing users to the copy they can't access.

Periodically we have to remove prefixes that have crept in.
This commit applies today's round of that.

Change-Id: Iaa169635664d0562a1cccc57c3e02b687b3493e7
Reviewed-on: https://go-review.googlesource.com/c/website/+/378597
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: DO NOT USE <katiehockman@google.com>
Trust: DO NOT USE <katiehockman@google.com>
2022-01-14 18:05:40 +00:00
Alberto Donizetti d8d1119db1 tour: move img/tree.png into static/img
The tree image at the concurrency/7 is not visible because the lessons
uses

  .image /tour/static/img/tree.png

but /img/tree.png was moved at the top level content dir. Move the
image into static/img to fix the link, we don't need an additional img
folder at top level.

Fixes golang/tour#1277
Fixes golang/tour#1274

Change-Id: I0a7d2cada7f33e7b84aac1bc6844e7f45754a1ec
Reviewed-on: https://go-review.googlesource.com/c/website/+/367334
Trust: Alberto Donizetti <alb.donizetti@gmail.com>
Run-TryBot: Alberto Donizetti <alb.donizetti@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
2021-12-02 09:59:10 +00:00
Alexander Rakoczy f750826771 tour/content: remove links to broken translations
These translations have been unavailable for some time.

Updates golang/tour#1039
Fixes golang/go#49900

Change-Id: I511848e600d4cb49a60cd1ce6778805e093ab0d9
Reviewed-on: https://go-review.googlesource.com/c/website/+/368138
Trust: Alexander Rakoczy <alex@golang.org>
Run-TryBot: Alexander Rakoczy <alex@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
Website-Publish: Dmitri Shuralyov <dmitshur@google.com>
2021-12-01 19:34:00 +00:00
Russ Cox c937063ca3 _content/tour: fix links, fix CSP policy for tour
Some links were missing the /tour/ at the front.

The tour also has links like <a href="javascript:next()">, which require
us to set unsafe-inline (or else enumerate the SHA256 of every link)
in the CSP header.

Also make the local server a bit more tour-friendly.

Fixes golang/go#49880.

Change-Id: Ice746571db1a34e1c02b4b2a16c4e9f30dc164d1
Reviewed-on: https://go-review.googlesource.com/c/website/+/368034
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-11-30 23:33:38 +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 b8a52b2c94 _content: replace talks.golang.org links with go.dev/talks
Change-Id: Id33adb085a38f879694cc8c4e241f9e8ab805fdb
Reviewed-on: https://go-review.googlesource.com/c/website/+/365495
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: Jamal Carvalho <jamal@golang.org>
2021-11-22 20:36:16 +00:00
Russ Cox 9d77df7a83 _content: replace scheme-relative URLs with https://
The time for scheme-relative URLs has passed.

go.dev, like all of .dev, is an HTTPS-only domain.
And golang.org has set HSTS headers for years too.
So these relative links are always going to be https:// on the internet.
When serving from http://localhost, they turn into http://,
which is never what we want.
So rewrite them all to hard-code https://.

Change-Id: I1c25108910a12f2974b8f6ba86d49d0b697516a4
Reviewed-on: https://go-review.googlesource.com/c/website/+/365099
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
2021-11-22 16:43:11 +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