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

Print error if index value in a page is wrong type
This commit is contained in:
Steve Francia 2013-08-20 20:56:33 -07:00
commit eb4288e3cd

View file

@ -362,8 +362,13 @@ 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)
s.Indexes[plural].Add(idx, s.Pages[i]) if ok {
for _, idx := range v {
s.Indexes[plural].Add(idx, s.Pages[i])
}
} else {
PrintErr("Invalid " + plural + " in " + p.File.FileName)
} }
} }
} }