Recreating categories and tags | template lookup?


#1

So, I’m trying to get my site built in Hugo – repo here – after using WordPress for years. I’ve got most of the basics running, but categories and tags are incredibly confusing – I’ve read all the docs I can find.

I’ve got categories in all the front matter for each post (in /content/post), and I’ve got a template for each post (/layouts/post/single.html) to show the categories :

  {{ if isset .Params "categories" }}
            <div class="level-item">
                <p class="heading">In:  {{ range .Params.categories }}
                    <a href="{{ "/categories/" | relLangURL }}{{ . | urlize }}">{{ . }}</a>
                {{ end }}</p>
            </div>
            {{ end }}

That all seems to work OK. It generates a page at /categories/term/, but that’s blank.

Where do I put a template to make this list the content associated with a category’s term? I’ve got a directory called ‘categories’ in /layouts… and that doesn’t seem to be working.

Here’s my layout structure:

themes/zb/layouts/
├── 404.html
├── _default
│ ├── baseof.html
│ ├── list.html
│ ├── section.html
│ └── single.html
├── categories
│ └── terms.html
├── index.html
├── partials
│ ├── about.html
│ ├── blog-home.html
│ ├── footer.html
│ ├── head.html
│ ├── hero-image.html
│ ├── hero-node.html
│ ├── hero-video.html
│ ├── nav.html
│ ├── post-hero.html
│ ├── post-list.html
│ ├── three-tiles.html
│ ├── top-section.html
│ ├── video.html
│ └── wood-section.html
├── post
│ ├── post.html
│ └── single.html
└── section-old
└── post.html