mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-07 20:30:36 -05:00
hugolib: Improve error message for bad taxonomy weights
Error is now "Unable to convert taxonomy weight []string{"40"} to int for variables/files.md"
This commit is contained in:
parent
1fd30d462e
commit
d3b81ee58e
1 changed files with 3 additions and 2 deletions
|
@ -1470,9 +1470,10 @@ func (s *Site) assembleTaxonomies() {
|
|||
for _, p := range s.Pages {
|
||||
vals := p.getParam(plural, !s.Info.preserveTaxonomyNames)
|
||||
|
||||
weight, err := cast.ToIntE(p.getParamToLower(plural + "_weight"))
|
||||
w := p.getParamToLower(plural + "_weight")
|
||||
weight, err := cast.ToIntE(w)
|
||||
if err != nil {
|
||||
s.Log.ERROR.Print("unable to convert taxonomy weight to int")
|
||||
s.Log.ERROR.Printf("Unable to convert taxonomy weight %#v to int for %s", w, p.Source.File.Path())
|
||||
// weight will equal zero, so let the flow continue
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue