Is it possible to sort taxonomy terms based on a set term weight?

Replace {{ .File.Dir | title }} with {{ .Title }} but you need to specify the titles in the front matter of the taxonomy terms’ _index.md (currently in these files you have only entered weight and as a result the .Title variable returns empty, I used the .File.Dir variable to illustrate the end result.

Also have a look at: Taxonomies | Hugo

3 Likes

Alternatively, we may use {{ path.Base .File.Dir }}.

So, essentially we treat taxonomy as a page.

Essentially, as I understand what’s missing are
.Site.Taxonomies.categories.ByWeight and .ByParam
Missing those we have to use more complicated solutions with GetPage and treat taxonomy as a page.
We cannot retrieve taxonomy params outside taxonomy templates. Right?

@alexandros Thanks a lot for your help. I really appreciate.

1 Like

@alexandros
Unfortunately this solutions does not work if I have
disableKinds: [“taxonomy”,“taxonomyTerm”] at my config.yaml

Since taxonomy pages are not wished in the site, I have to use this solution and then with a script delete the taxonomy pages. So, this is not an ideal situation.