New section tags and category not rendering - what could it be? [hugo-universal-theme]

This is a question as to how to troubleshoot. I am using unversal theme and works very nicely.

content/
       --blog/
       --competency/
                   --_index.md

I understand Hugo automatically handles any tags and categories from frontmatter. In my case the new tags and new categories get counted properly - I can see the number of posts under given catagory increase under sidebar widget, but is not rendering for the new section. I.e. if I click on category that from the new section, the new section posts do not get rendered. However if I add category to the posts in the blog/ section - they get rendered OK. So my guess is I have messed up something when creating my new section. But what could it be?

It is confusing particularly because the original content section content/blog does not contain any _index.md file.

Looking through the generated public/ folder I found something strange - for all categories and tags there is structure - (same way for categories and tags)

categories
    category
        index.html
        index.xml

So for working categories there is content gathered from relevant markdown files both in index.xml and index.html files. For not-working categories content is only in index.xml but NOT in index.html. Exact same thing goes for tags.

Since the theme does not specifically define any taxonomies it seems this has something to do with Hugo default behaviour: found taxonomies: map[string]string{"tag":"tags", "category":"categories"}

For completeness sake: there is also page under category but that contains only aliases as in: Alias "/tags/competencies/page/1/index.html" translated to "tags/competencies/page/1/index.html".

I found the culprit here - it is described also in universal theme bug tracker but apparently has not been addressed.

hugo-universal-theme
        layouts
            _default
                  list.html
theme-universal-hugo
        partials
             recent_posts.html

Essentially in the above two places there is a paginator line like this:

  {{ $posts := .Paginate (where .Data.Pages "Type" "blog") }}

therefore “paginates” only blog type
In the first instance I changed it to: {{ $paginator := .Paginate .Data.Pages }} and that lets see content from both/all sections. In the second instance I left it as it is because I want only blog posts to be tracked under recents. The new section I created is for more permanent content.

Now the site is great fun to do :slight_smile:

1 Like