go.dev: update to new interim menus
Also fix site footer to file x/website issue, not x/pkgsite.
Change-Id: I6549b7b4108ef51b41c2715577beb785943a50a6
Reviewed-on: https://go-review.googlesource.com/c/website/+/342093
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
diff --git a/cmd/golangorg/server.go b/cmd/golangorg/server.go
index cc72ae4..6f61dcb 100644
--- a/cmd/golangorg/server.go
+++ b/cmd/golangorg/server.go
@@ -444,6 +444,14 @@
ct string // content-type
}
+func (r *linkRewriter) WriteHeader(code int) {
+ loc := r.Header().Get("Location")
+ if strings.HasPrefix(loc, "/") {
+ r.Header().Set("Location", "/"+r.host+loc)
+ }
+ r.ResponseWriter.WriteHeader(code)
+}
+
func (r *linkRewriter) Write(data []byte) (int, error) {
if r.ct == "" {
ct := r.Header().Get("Content-Type")
diff --git a/go.dev/_content/learn/index.md b/go.dev/_content/learn/index.md
index 816d669..2ee639a 100644
--- a/go.dev/_content/learn/index.md
+++ b/go.dev/_content/learn/index.md
@@ -1,5 +1,5 @@
---
-title: "Getting Started"
+title: "Get Started"
---
<section class="Learn-hero">
diff --git a/go.dev/_content/menus.yaml b/go.dev/_content/menus.yaml
index 321d996..ec94219 100644
--- a/go.dev/_content/menus.yaml
+++ b/go.dev/_content/menus.yaml
@@ -1,12 +1,16 @@
main:
- name: Why Go
url: /solutions/
- - name: Getting Started
+ - name: Get Started
url: /learn/
- - name: Discover Packages
+ - name: Docs
+ url: https://golang.org/doc/
+ - name: Packages
url: https://pkg.go.dev
- - name: About
- url: /about
+ - name: Play
+ url: https://play.golang.org/
+ - name: Blog
+ url: /blog/
footer:
- name: Why Go
@@ -17,7 +21,7 @@
- name: Case Studies
url: /solutions/#case-studies
- - name: Getting Started
+ - name: Get Started
url: /learn/
children:
- name: Playground
@@ -27,7 +31,7 @@
- name: Stack Overflow
url: https://stackoverflow.com/questions/tagged/go?tab=Newest
- - name: Discover Packages
+ - name: Packages
url: https://pkg.go.dev
- name: About
@@ -36,7 +40,7 @@
- name: Download
url: https://golang.org/dl/
- name: Blog
- url: https://blog.golang.org
+ url: /blog/
- name: Issue Tracker
url: https://github.com/golang/go/issues
- name: Release Notes
diff --git a/go.dev/_content/site.tmpl b/go.dev/_content/site.tmpl
index c77e6d3..e2cf7bb 100644
--- a/go.dev/_content/site.tmpl
+++ b/go.dev/_content/site.tmpl
@@ -59,7 +59,7 @@
<ul class="Header-menu">
{{- $currentPage := .}}
{{- range $menus.main}}
- <li class="Header-menuItem {{if eq $currentPage.title .name}} Header-menuItem--active{{end}}">
+ <li class="Header-menuItem {{if strings.HasPrefix $currentPage.URL .url}} Header-menuItem--active{{end}}">
<a href="{{.url}}">{{.name}}</a>
</li>
{{- end}}
@@ -93,7 +93,7 @@
</div>
<ul class="NavigationDrawer-list">
{{- range $menus.main}}
- <li class="NavigationDrawer-listItem {{if eq .url (section $currentPage)}} NavigationDrawer-listItem--active{{end}}">
+ <li class="NavigationDrawer-listItem {{if strings.HasPrefix $currentPage.URL .url}} NavigationDrawer-listItem--active{{end}}">
<a href="{{.url}}">{{.name}}</a>
</li>
{{- end}}
@@ -143,7 +143,7 @@
</li>
<li class="Footer-listItem">
<a
- href="https://golang.org/s/discovery-feedback"
+ href="https://golang.org/s/website-issue"
target="_blank"
rel="noopener"
>