For a few weeks now, I’ve been having two issues with my Archive page:
-
The categories listed at the top direct to a full listing of all my posts, essentially my website’s home page. This is despite the URL displaying as I would expect, e.g., hovering on “Podcasts” shows “
https://www.dandy.cat/categories/podcasts/
”. -
The categories at the top of the page are not alphabetized. It appears to be a random sorting that doesn’t reflect the order on my Categories page on Micro.blog (which is itself unordered, but that’s another topic).
For my theme, I’m using Kiko, which I’ve set as a custom theme as opposed to using it as a plug-in. I’ve set the Hugo version to 0.91 (this behavior also happened on 0.54).
I’ve added some custom CSS, but I don’t know how that would cause this issue.
My best guess is something is wonky with the custom template Archive page (layouts/list.archivehtml.html), but I would appreciate guidance on what it actually may be and how to fix it. As unlikely as it seems, I believe this started happening on its own, or at least, I didn’t do anything to alter any of my custom template pages when this started happening.
Here is what’s present on the Archive template page:
{{ define "main" }}
<h1 class="page-title">Archive</h1>
<h2>Categories</h2>
{{ $list := ($.Site.GetPage "taxonomyTerm" "categories").Pages }}
{{ if gt (len $list) 0 }}
<div class="archive_categories" style="border-bottom: 1px solid lightgray; padding-bottom: 15px; margin-bottom: 30px;">
{{ range $list }}
<p><a href="{{ .Permalink }}">{{ .Title }}</a></p>
{{ end }}
</div>
{{ end }}
{{ $list := (where .Site.Pages "Type" "post") }}
{{ range $list }}
<h2>Posts</h2>
<p class="h-entry">
<a href="{{ .Permalink }}" class="u-url"><span class="dt-published" datetime="{{ .Date.Format "2006-01-02T15:04:05-0700" }}">{{ .Date.Format "2006-01-02" }}</span></a>:
<span class="p-name"><b>{{ .Title }}</b></span>
<span class="p-summary">{{ .Summary | truncate 100 }}</span>
</p>
{{ end }}
{{ end }}
If anything else is needed from me to help diagnose this issue, please let me know. Thanks!