diff options
| author | Alan Donovan <adonovan@google.com> | 2025-10-15 10:57:11 -0400 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2025-10-15 10:29:22 -0700 |
| commit | d3e81a26cf8796bc053fb812eba8dcb15f0b1c84 (patch) | |
| tree | 31b0af6e8d3c97a725eeacaf6091b6a016645527 | |
| parent | 694921d3ff0fa99118d456054f3f5166539db49e (diff) | |
| download | go-x-website-d3e81a26cf8796bc053fb812eba8dcb15f0b1c84.tar.xz | |
_content/site.tmpl: add canonical link
This change adds to each page a 'canonical' link
so that search engines will index only the go.dev
copy of a particular page instead of the tip.golang.org
one.
(Beware that in local testing the golangorg.hostPathHandler
function rewrites https://go.dev URLs to refer to localhost,
so this change does not have the desired effect in that mode.)
Updates golang/go#69600
Change-Id: I5bd8b0e0ac1b1d1a0d1b67b30e600246ed0beab8
Reviewed-on: https://go-review.googlesource.com/c/website/+/712040
Reviewed-by: Sean Liao <sean@liao.dev>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Auto-Submit: Alan Donovan <adonovan@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
| -rw-r--r-- | _content/site.tmpl | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/_content/site.tmpl b/_content/site.tmpl index 081986de..59687ef1 100644 --- a/_content/site.tmpl +++ b/_content/site.tmpl @@ -13,6 +13,7 @@ <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="theme-color" content="#00add8"> +<link rel="canonical" href="https://go.dev{{.URL}}"> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Material+Icons"> <link rel="stylesheet" href="/css/styles.css"> <link rel="icon" href="/images/favicon-gopher.png" sizes="any"> |
