[solved: dirname to lowercase] Taxonomy description issue

I`m trying to add individual descriptions to my taxonomies using _index.md approach, but when i create this file i end up with only this file content, without list of corresponding posts of that taxonomy.
Hugo v 0.39

/content/skin/AK-47-Cartel.md

...
"weapon": "AK-47",
...

/content/weapon/AK-47/_index.md with only one line of code - description:

"desc": "Some desc"

config.toml:

[taxonomies]
weapon = "weapon"

layouts/_default/list.html:

{{ .Params.Desc}}
{{ $paginator := .Paginate (where .Data.Pages "Type" "skin") (index .Site.Params "paginate" | default 10) }}
{{ range $paginator.Pages }}
    {{ .Render "content" }}
{{ end }}

So when i try to see any other taxonomy (not AK-47) i get expected list of posts, but if i`m watching AK-47 i get only ‘Some desc’ text and no posts under it

Edited: rename ‘Description’ to ‘Desc’

As far as I understand, the variable .Description is reserved and it should be used without the .Params.

As for the list, I would suggest creating a separate template for the taxonomy weapon.

/layouts/taxonomy/weapon.html

{{ .Description}}
{{ range .Pages }}
  <li><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></li>
{{ end }}

And debug it separately.

1 Like

Well, i named that var as ‘desc’ in my original code.
As for separate template - good idea, but still no luck. With your code i get normal list of posts for all taxonomies, except AK-47 (the only taxonomy with _index.md file). For that taxonomy i`m able to get ‘desc’, but no list of posts.
Hugo v0.40.2

Tak-to nuzni esche idei, @mikhail

I found it!

That was a problem. Dir name was not lowercase. Renamed id to “ak-47” and it works!

1 Like