hugo

Unnamed repository; edit this file 'description' to name the repository.

git clone git://git.shimmy1996.com/hugo.git
commit eb4288e3cd47fae5c519ae0fb8e654828540e7a6
parent 00839567c764ee047ede5ead8fb1f7bcbd8b03fb
Author: Steve Francia <steve.francia@gmail.com>
Date:   Tue, 20 Aug 2013 20:56:33 -0700

Merge pull request #53 from hugoduncan/feature/print-error-on-invalid-index

Print error if index value in a page is wrong type
Diffstat:
Mhugolib/site.go | 9+++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/hugolib/site.go b/hugolib/site.go
@@ -362,8 +362,13 @@ func (s *Site) BuildSiteMeta() (err error) {
 			vals := p.GetParam(plural)
 
 			if vals != nil {
-				for _, idx := range vals.([]string) {
-					s.Indexes[plural].Add(idx, s.Pages[i])
+				v, ok := vals.([]string)
+				if ok {
+					for _, idx := range v {
+						s.Indexes[plural].Add(idx, s.Pages[i])
+					}
+				} else {
+					PrintErr("Invalid " + plural + " in " + p.File.FileName)
 				}
 			}
 		}