Print error if index value in a page is wrong type

This was causing a panic with no information displayed about the
page causing the error.
This commit is contained in:
Hugo Duncan 2013-08-20 16:39:26 -04:00
parent eff8457ac9
commit 301d2bafcd

View file

@ -362,9 +362,14 @@ func (s *Site) BuildSiteMeta() (err error) {
vals := p.GetParam(plural) vals := p.GetParam(plural)
if vals != nil { if vals != nil {
for _, idx := range vals.([]string) { v, ok := vals.([]string)
if ok {
for _, idx := range v {
s.Indexes[plural].Add(idx, s.Pages[i]) s.Indexes[plural].Add(idx, s.Pages[i])
} }
} else {
PrintErr("Invalid " + plural + " in " + p.File.FileName)
}
} }
} }
for k, _ := range s.Indexes[plural] { for k, _ := range s.Indexes[plural] {