How to link tags list to post list

#1

Very newbie for Hugo, but I still need to ask for help after I try a lot of ways.
I’m trying to customize the theme tanka, which has no taxonomy, with the tags and categories part from the theme Xmin.
I transplanted the part of theme/layouts/_default/ list.html and term.html two file to my part. And add the code

[taxonomies]
   tag = "tags"
   category = "categories"

on config.toml.
OK, the tags and categories list come out then, but when I try to click the tags listed on, the tags just link to a empty page, which should be a list under this tags.
And the code of the list.html file like this:

{{ partial "header.html" . }}

{{if not .IsHome }}
<h1>{{ .Title | markdownify }}</h1>
{{ end }}

{{ .Content }}

<ul>
  {{ range (where .Data.Pages "Section" "!=" "") }}
  <li>
<span class="date">{{ .Date.Format "2006/01/02" }}</span>
<a href="{{ .URL }}">{{ .Title | markdownify }}</a>
  </li>
  {{ end }}
</ul>

{{ partial "footer.html" . }}
#2

You should share a repo we can clone to reproduce. Without seeing that, we can’t really tell. But I’m guessing you just need to adjust the templates you pulled over to fit your config options and content structure. Read Requesting Help and get back to us. :slight_smile:

#3

thank you! With I don’t know reason, my site’s taxonomy is working on now.

1 Like