fix web static file path slash error for win platform
Signed-off-by: copperyp <copperyp@gmail.com>
This commit is contained in:
parent
84b241721e
commit
a1c1076137
@ -109,7 +109,7 @@ func loadWebConfig(c webConfig) (http.Handler, http.Handler, *templates, error)
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, nil, nil, fmt.Errorf("read static dir: %v", err)
|
return nil, nil, nil, fmt.Errorf("read static dir: %v", err)
|
||||||
}
|
}
|
||||||
themeFiles, err := fs.Sub(c.webFS, filepath.Join("themes", c.theme))
|
themeFiles, err := fs.Sub(c.webFS, filepath.ToSlash(filepath.Join("themes", c.theme)))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, nil, nil, fmt.Errorf("read themes dir: %v", err)
|
return nil, nil, nil, fmt.Errorf("read themes dir: %v", err)
|
||||||
}
|
}
|
||||||
@ -133,7 +133,7 @@ func loadTemplates(c webConfig, templatesDir string) (*templates, error) {
|
|||||||
if file.IsDir() {
|
if file.IsDir() {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
filenames = append(filenames, filepath.Join(templatesDir, file.Name()))
|
filenames = append(filenames, filepath.ToSlash(filepath.Join(templatesDir, file.Name())))
|
||||||
}
|
}
|
||||||
if len(filenames) == 0 {
|
if len(filenames) == 0 {
|
||||||
return nil, fmt.Errorf("no files in template dir %q", templatesDir)
|
return nil, fmt.Errorf("no files in template dir %q", templatesDir)
|
||||||
|
Reference in New Issue
Block a user