shithub: hugo

Download patch

ref: c9a09418e7b1cf0d6c77d46ac1dc8a703b341ac2
parent: 61258858af90fc43bea406af5f065d0b2e6c94dc
author: Noah Campbell <[email protected]>
date: Thu Aug 1 09:27:07 EDT 2013

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.

--- a/hugolib/page.go
+++ b/hugolib/page.go
@@ -91,7 +91,7 @@
 }
 
 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