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
This commit is contained in:
Tw 2013-10-08 16:55:56 +11:00 committed by Andrew Gerrand
parent 5d9b86d6ce
commit da6f00a60b

View File

@ -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,