How to sort a taxonomy in alphabetical order?

The following code used to work as per the docs:

  {{range sort .Params.categories}}
   {{.}}
  {{end}}

But since I upgraded from v0.55.6 to v0.59.1, I get the error:

error calling sort: sequence must be provided

I’ve tried several different variations, such as

{{range sort .Params.categories "asc"}}

But I can’t get the sort function to work. What am I missing? Thanks.

Did you forgot the value arg?

{{ range sort .Params.tags "value" "desc" }}

I’ve tried doing that as well, but I still get an error.

I’m unable to reproduce. Please share a repo that reproduces this error. :slight_smile:

2 Likes

Thank you for testing.

I tried the sort function in another project and it works fine so something somewhere is causing an issue in my code. Will troubleshoot and let you folks on here know if I find what’s causing the error.

It took a few hours to figure out, but the reason I’m getting an error when calling sort is because of this pesky little bug.