mirror of
https://github.com/golang/go.git
synced 2025-05-05 15:43:04 +00:00
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:
parent
5d9b86d6ce
commit
da6f00a60b
@ -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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user