_content: move content/static/* to _content/*
The extra level of hierarchy here is unnecessary and confusing.
The directory is now _content so that any Go source files in our
docs are not considered by commands like "go mod tidy" and
"go test all".
Change-Id: Ib6d7cb12920193798ee825155a8f8b33f16e60d8
Reviewed-on: https://go-review.googlesource.com/c/website/+/291691
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>
diff --git a/content.go b/content.go
new file mode 100644
index 0000000..b3b7245
--- /dev/null
+++ b/content.go
@@ -0,0 +1,27 @@
+// Copyright 2013 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// +build go1.16
+
+// Package website exports the static content as an embed.FS.
+package website
+
+import (
+ "embed"
+ "io/fs"
+)
+
+// Content is the website's static content.
+var Content = subdir(embedded, "_content")
+
+//go:embed _content
+var embedded embed.FS
+
+func subdir(fsys fs.FS, path string) fs.FS {
+ s, err := fs.Sub(fsys, path)
+ if err != nil {
+ panic(err)
+ }
+ return s
+}