diff options
| author | Russ Cox <rsc@golang.org> | 2021-11-17 22:51:08 -0500 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2021-11-22 16:42:59 +0000 |
| commit | 40c0eef09728d0b38f740dfe55031330800b1456 (patch) | |
| tree | 6aef5e319eaf8ba0b3824a679eae62dd40e8bdc2 /cmd | |
| parent | 370a0d0e46fcdb0c463d1ee7344c14ec67c210e2 (diff) | |
| download | go-x-website-40c0eef09728d0b38f740dfe55031330800b1456.tar.xz | |
go.dev: merge go.dev/_content into root _content
Many renames. And then adjust references.
Change-Id: I4d03c76dbc0bf4d070208d568861ee820904c0dc
Reviewed-on: https://go-review.googlesource.com/c/website/+/365097
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
Diffstat (limited to 'cmd')
| -rw-r--r-- | cmd/events/main.go | 2 | ||||
| -rw-r--r-- | cmd/golangorg/cloudbuild.yaml | 2 | ||||
| -rw-r--r-- | cmd/golangorg/server.go | 15 | ||||
| -rw-r--r-- | cmd/golangorg/server_test.go | 3 |
4 files changed, 9 insertions, 13 deletions
diff --git a/cmd/events/main.go b/cmd/events/main.go index 5f5d35c4..892e4958 100644 --- a/cmd/events/main.go +++ b/cmd/events/main.go @@ -26,7 +26,7 @@ const ( // eventsHeader is a header comment for the output content. eventsHeader = `# DO NOT EDIT: Autogenerated from cmd/events. # To update, run: -# go run ./cmd/events > go.dev/_content/events.yaml` +# go run ./cmd/events > _content/events.yaml` ) func main() { diff --git a/cmd/golangorg/cloudbuild.yaml b/cmd/golangorg/cloudbuild.yaml index 51e92a3b..4dcd88c3 100644 --- a/cmd/golangorg/cloudbuild.yaml +++ b/cmd/golangorg/cloudbuild.yaml @@ -19,7 +19,7 @@ steps: args: ["go", "test", "./..."] - name: golang entrypoint: bash - args: ["-c", "go run ./cmd/events/ > ./go.dev/_content/events.yaml"] + args: ["-c", "go run ./cmd/events/ > ./_content/events.yaml"] - name: gcr.io/cloud-builders/gcloud entrypoint: bash args: ["./go-app-deploy.sh", "cmd/golangorg/app.yaml"] diff --git a/cmd/golangorg/server.go b/cmd/golangorg/server.go index b8187298..eec03c54 100644 --- a/cmd/golangorg/server.go +++ b/cmd/golangorg/server.go @@ -135,13 +135,11 @@ func NewHandler(contentDir, goroot string) http.Handler { // Serve files from _content, falling back to GOROOT. // Use explicit contentDir if specified, otherwise embedded copy. - var golangFS, godevFS fs.FS + var contentFS fs.FS if contentDir != "" { - golangFS = os.DirFS(contentDir) - godevFS = os.DirFS(filepath.Join(contentDir, "../go.dev/_content")) + contentFS = os.DirFS(contentDir) } else { - golangFS = website.Golang - godevFS = website.Godev + contentFS = website.Content } var gorootFS fs.FS @@ -157,9 +155,8 @@ func NewHandler(contentDir, goroot string) http.Handler { // tip.golang.org serves content from the very latest Git commit // of the main Go repo, instead of the one the app is bundled with. - // TODO(rsc): The unionFS is a hack until we move the files in a followup CL. var tipGoroot atomicFS - if _, err := newSite(mux, "tip.golang.org", unionFS{godevFS, golangFS}, &tipGoroot); err != nil { + if _, err := newSite(mux, "tip.golang.org", contentFS, &tipGoroot); err != nil { log.Fatalf("loading tip site: %v", err) } if *tipFlag { @@ -187,11 +184,11 @@ func NewHandler(contentDir, goroot string) http.Handler { // TODO(rsc): The unionFS is a hack until we move the files in a followup CL. siteMux := http.NewServeMux() - godevSite, err := newSite(siteMux, "", unionFS{godevFS, golangFS}, gorootFS) + godevSite, err := newSite(siteMux, "", contentFS, gorootFS) if err != nil { log.Fatalf("newSite go.dev: %v", err) } - chinaSite, err := newSite(siteMux, "golang.google.cn", unionFS{godevFS, golangFS}, gorootFS) + chinaSite, err := newSite(siteMux, "golang.google.cn", contentFS, gorootFS) if err != nil { log.Fatalf("newSite golang.google.cn: %v", err) } diff --git a/cmd/golangorg/server_test.go b/cmd/golangorg/server_test.go index 0b6524e4..eae855aa 100644 --- a/cmd/golangorg/server_test.go +++ b/cmd/golangorg/server_test.go @@ -73,6 +73,5 @@ func TestAll(t *testing.T) { }) } - testTree("../../_content", "https://golang.org") - testTree("../../go.dev/_content", "https://go.dev") + testTree("../../_content", "https://go.dev") } |
