2021-02-12 22:32:52 +03:00
|
|
|
// 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.
|
|
|
|
|
|
|
|
// Package website exports the static content as an embed.FS.
|
|
|
|
package website
|
|
|
|
|
|
|
|
import (
|
2021-08-20 17:18:33 +03:00
|
|
|
"embed"
|
2021-08-20 17:31:05 +03:00
|
|
|
"io/fs"
|
2021-02-12 22:32:52 +03:00
|
|
|
)
|
|
|
|
|
2021-08-20 17:18:33 +03:00
|
|
|
// Golang is the golang.org website's static content.
|
|
|
|
var Golang fs.FS = subdir(embedded, "_content")
|
2021-05-26 18:49:34 +03:00
|
|
|
|
2021-08-20 17:18:33 +03:00
|
|
|
// Godev is the go.dev website's static content.
|
|
|
|
var Godev fs.FS = subdir(embedded, "go.dev/_content")
|
2021-02-12 22:32:52 +03:00
|
|
|
|
2021-08-20 17:18:33 +03:00
|
|
|
//go:embed _content go.dev/_content
|
|
|
|
var embedded embed.FS
|
2021-02-12 22:32:52 +03:00
|
|
|
|
|
|
|
func subdir(fsys fs.FS, path string) fs.FS {
|
|
|
|
s, err := fs.Sub(fsys, path)
|
|
|
|
if err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
|
|
|
return s
|
|
|
|
}
|