mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-18 21:11:19 +02:00
Normalize paths within hugo
filepath was used inconsistently throughout the hugolib. With the introduction of source and target modules, all path are normalized to "/". This simplifies the processing of paths. It does mean that contributors need to be aware of using path/filepath in any module other than source or target is not recommended. The current exception is hugolib/config.go
This commit is contained in:
@@ -27,6 +27,7 @@ func (f *Filesystem) Files() []*File {
|
||||
}
|
||||
|
||||
func (f *Filesystem) add(name string, reader io.Reader) {
|
||||
name = filepath.ToSlash(name)
|
||||
f.files = append(f.files, &File{Name: name, Contents: reader})
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user