diff --git a/template.go b/template.go index c513567d..73210487 100644 --- a/template.go +++ b/template.go @@ -140,9 +140,10 @@ func (self *templatefile) visit(paths string, f os.FileInfo, err error) error { } } if hasExt { + replace := strings.NewReplacer("\\", "/") a := []byte(paths) a = a[len([]byte(self.root)):] - subdir := path.Dir(strings.TrimLeft(string(a), "/")) + subdir := path.Dir(replace.Replace(strings.TrimLeft(string(a), "/"))) if _, ok := self.files[subdir]; ok { self.files[subdir] = append(self.files[subdir], paths) } else {