From da6f00a60b87392dc9207dc60cf1c1a18451cc18 Mon Sep 17 00:00:00 2001 From: Tw Date: Tue, 8 Oct 2013 16:55:56 +1100 Subject: [PATCH] go.tools/blog: replace "\\" with "/" in path string to be compatible with windows platform Fixes golang/go#6539 The problem happens on my win7, for example, the path is "/content\\foo.article". It leads to the wrong link in generated html page. So I think we should replace all"\\" with "/" in path string at first. R=golang-dev, dsymonds, mirtchovski, dave, adg, alex.brainman CC=golang-dev https://golang.org/cl/14023043 --- blog/blog.go | 1 + 1 file changed, 1 insertion(+) diff --git a/blog/blog.go b/blog/blog.go index 848f572e..c6f1e068 100644 --- a/blog/blog.go +++ b/blog/blog.go @@ -189,6 +189,7 @@ func (s *Server) loadDocs(root string) error { return err } p = p[len(root) : len(p)-len(ext)] // trim root and extension + p = filepath.ToSlash(p) s.docs = append(s.docs, &Doc{ Doc: d, Path: s.cfg.BasePath + p,