mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -05: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:
parent
61258858af
commit
c9a09418e7
1 changed files with 1 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue