mirror of
https://github.com/gohugoio/hugo.git
synced 2024-05-11 05:54:58 +00:00
Fixed section labels causing panic on windows.
The filename path was being split using a unix specific path seperator. This fix uses the os.PathSeperator to ensure proper evaluation regardless of platform.
This commit is contained in:
@ -91,7 +91,7 @@ func initializePage(filename string) (page Page) {
|
||||
}
|
||||
|
||||
func (p *Page) setSection() {
|
||||
x := strings.Split(p.FileName, "/")
|
||||
x := strings.Split(p.FileName, string(os.PathSeparator))
|
||||
|
||||
if section := x[len(x)-2]; section != "content" {
|
||||
p.Section = section
|
||||
|
Reference in New Issue
Block a user