internal/tour: fix go.dev/tour
The playground js was coming from godoc instead of the updated copy in go.dev. Change-Id: I26be8634b0e5d453b966be758f08c15b4bc7ca72 Reviewed-on: https://go-review.googlesource.com/c/website/+/366376 Trust: Russ Cox <rsc@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> Website-Publish: Russ Cox <rsc@golang.org>
This commit is contained in:
Родитель
d122f972e5
Коммит
ad69553815
|
@ -23,7 +23,10 @@ func TourOnly() fs.FS {
|
|||
//go:embed _content
|
||||
var embedded embed.FS
|
||||
|
||||
//go:embed _content/tour _content/favicon.ico _content/images/go-logo-white.svg
|
||||
//go:embed _content/favicon.ico
|
||||
//go:embed _content/images/go-logo-white.svg
|
||||
//go:embed _content/js/playground.js
|
||||
//go:embed _content/tour
|
||||
var tourOnly embed.FS
|
||||
|
||||
func subdir(fsys fs.FS, path string) fs.FS {
|
||||
|
|
|
@ -19,7 +19,6 @@ import (
|
|||
"strings"
|
||||
"time"
|
||||
|
||||
"golang.org/x/tools/godoc/static"
|
||||
"golang.org/x/tools/present"
|
||||
"golang.org/x/website"
|
||||
)
|
||||
|
@ -231,14 +230,9 @@ func initScript(mux *http.ServeMux, socketAddr, transport string) error {
|
|||
modTime := time.Now()
|
||||
b := new(bytes.Buffer)
|
||||
|
||||
content, ok := static.Files["playground.js"]
|
||||
if !ok {
|
||||
return fmt.Errorf("playground.js not found in static files")
|
||||
}
|
||||
b.WriteString(content)
|
||||
|
||||
// Keep this list in dependency order
|
||||
files := []string{
|
||||
"../js/playground.js",
|
||||
"static/lib/jquery.min.js",
|
||||
"static/lib/jquery-ui.min.js",
|
||||
"static/lib/angular.min.js",
|
||||
|
@ -253,7 +247,7 @@ func initScript(mux *http.ServeMux, socketAddr, transport string) error {
|
|||
}
|
||||
|
||||
for _, file := range files {
|
||||
f, err := fs.ReadFile(contentTour, "tour/"+file)
|
||||
f, err := fs.ReadFile(contentTour, path.Clean("tour/"+file))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче