Cannot figure out how to add content to a taxonomy term using Academic Theme

Not sure what I am doing wrong, but cannot seem to add content to a taxonomy term. As a simple start I’ve been trying to add a title, image and description to a “tag”. Is there a suggested way to do this with the Academic theme?

This post Handling taxonomies like a boss - update has an exceptionally clear explanation, but for some reason I can’t get it to work.

Here’s the configuration in config.toml:
[taxonomies]
category = “categories”
tag = “tags”
author = “authors”
title = “titles”
origpublisher = “origpublishers”
origdate = “origdates”
synod = “synods”

In /content/tags/fiction/_index.md

title: “Fiction”
description:
This is a very long description text that continues on and on and on.
It has multiple paragraphs, too.
image: “/img/icon-192.png”

In /layouts/_default/terms.html

<ul>
  {{ range .Data.Pages }}
    <li>
      <a href="{{ .Permalink }}">{{ .Title }}</a>
      <dl>
        <dt>Link to the brand page</dt><dd><a href="{{ .Permalink }}">{{ .Permalink }}</a></dd>

        <!-- Handling brands that don't have a corresponding page by using 'with' -->
        {{ with .Params.description }}
          <dt>Description</dt><dd>{{ . }}</dd>
        {{ end }}

        <!--
        Handling brands that don't have a corresponding page by using an 'if' statement.
        This let's you add default values to your template.
        -->
        <dt>Logo</dt>
        <dd>
        {{ if ne .Params.logo nil }}
          <img src="{{ .Params.logo }}" height="90" />
        {{ else }}
          <img src="http://via.placeholder.com/90x90?text=No+logo" height="90" />
        {{ end }}
        </dd>
      </dl>
    </li>
  {{ end }}
</ul>

The site repository is here.
Any help greatly appreciated. Thank you.

The gitlab repository doesn’t seem to be up to date - I can’t see anything in /content/tags (the folder isn’t there) and also there isn’t a file `/layout/_default/terms.html’.

Hi @funkydan2,
Sorry about any confusion. The files are in /.ideas/layouts/_default and /.ideas/content/tags/fiction

If I leave them in the /layouts and /content directories, the hugo server won’t load.

Two ideas

  1. The example you linked to in your first post - the terms.html template makes use of the Base Template, which I don’t think the Academic theme uses. The Handling Taxonomies like a boss thread points you in the right direction, but (I think) you’ll need to base your terms.html on the Academic theme’s list.html (As in - use the Academic theme file as your starting point, and modify it to suit your needs).
  2. For testing, instead of putting things in a .ideas folder - make a testing branch in your repository. (I’m not git master, but doing this is the power of git.)
1 Like