diff options
| author | Russ Cox <rsc@golang.org> | 2021-06-02 19:45:50 -0400 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2021-06-03 11:23:40 +0000 |
| commit | 99ded550e825cbf8cbd28ac2a3f3a0baf3183214 (patch) | |
| tree | c52ec0026906f0136b710e8fc6f2329d37b77501 | |
| parent | b593c133e41f625a07bb3a2f8692d9898fca4b99 (diff) | |
| download | go-x-website-99ded550e825cbf8cbd28ac2a3f3a0baf3183214.tar.xz | |
go.dev/cmd/internal/site: fix tests on Windows
The site will never run on Windows, but keeping the tests passing
makes the x/website TryBots happy, and it is easy to do.
Fixes golang/go#46501.
Change-Id: Ib9ea07dc4164fbea38b7624c32a6f46d7bab6739
Reviewed-on: https://go-review.googlesource.com/c/website/+/324510
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
Website-Publish: Russ Cox <rsc@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
| -rw-r--r-- | go.dev/cmd/internal/site/page.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/go.dev/cmd/internal/site/page.go b/go.dev/cmd/internal/site/page.go index ed080be3..02c9f97f 100644 --- a/go.dev/cmd/internal/site/page.go +++ b/go.dev/cmd/internal/site/page.go @@ -9,6 +9,7 @@ import ( "fmt" "io/ioutil" "path" + "path/filepath" "strings" "time" @@ -32,6 +33,7 @@ type tPage map[string]interface{} // loadPage loads the site's page from the given file. // It returns the page but also adds the page to site.pages and site.pagesByID. func (site *Site) loadPage(file string) (*page, error) { + file = filepath.ToSlash(file) id := strings.TrimPrefix(file, "_content/") if id == "index.md" { id = "" |
