From 99ded550e825cbf8cbd28ac2a3f3a0baf3183214 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Wed, 2 Jun 2021 19:45:50 -0400 Subject: 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 Run-TryBot: Russ Cox Website-Publish: Russ Cox Reviewed-by: Dmitri Shuralyov --- go.dev/cmd/internal/site/page.go | 2 ++ 1 file changed, 2 insertions(+) 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 = "" -- cgit v1.3