mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-07 20:30:36 -05:00
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:
commit
eb4288e3cd
1 changed files with 7 additions and 2 deletions
|
@ -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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue