Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
hugolib: Improve error message for bad taxonomy weights
Error is now "Unable to convert taxonomy weight []string{"40"} to int
for variables/files.md"
  • Loading branch information
moorereason authored and bep committed Oct 3, 2018
1 parent 1fd30d4 commit d3b81ee
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions hugolib/site.go
Expand Up @@ -1470,9 +1470,10 @@ func (s *Site) assembleTaxonomies() {
for _, p := range s.Pages { for _, p := range s.Pages {
vals := p.getParam(plural, !s.Info.preserveTaxonomyNames) 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 { 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 // weight will equal zero, so let the flow continue
} }


Expand Down

0 comments on commit d3b81ee

Please sign in to comment.