Hi - I’ve got the following in a 404.html and am using it for my 404 page. It works. Currently I have topics, tags and series defined, and it comes up listed as:
- Series
- Tags
- Topics
With the content interspersed. However, I’d like to sort the top-level taxonomies the reverse of how they sort now, in alphabetical order.
I tried a few things like adding .ByCount or .Alphabetical.Reverse to:
{{ range $taxonomyname, $taxonomy := .Site.Taxonomies.Alphabetical.Reverse }}
… but nothing seems to work. This is what the template looks like now.
{{ partial "header.html" . }}
<body>
<div id="layout" class="pure-g">
{{ partial "sidebar.html" . }}
{{ partial "hometop.html" . }}
<div class="content pure-u-1 pure-u-md-3-4">
<a name="top"></a> {{ partial "listtop_home.html" . }}
<main>
<div class="posts">
<section class="post">
<header class="post-header">
<h1 class="post-title">Oh Dear, it's the dreaded «{{ .Title }}»</h1>
</header>
<article class="post-summary">
Thanks for visiting. You've reached my 404 page, meaning the content you tried to access cannot be found. Use the site search feature, or scan the below list of site taxonomies and click through to something of interest.
<ul>
{{ range $taxonomyname, $taxonomy := .Site.Taxonomies }}
<li><a href="/{{ $taxonomyname | urlize }}"><h2>{{ $taxonomyname }}</h2></a>
<ul>
{{ range $key, $value := $taxonomy }}
<li><h3>{{ $key }}</h3></li>
<ul>
{{ range $value.Pages }}
<li hugo-nav="{{ .RelPermalink }}"><a href="{{ .Permalink}}"><em>{{ .LinkTitle }}</em></a></li>
{{ end }}
</ul>
{{ end }}
</ul>
</li>
{{ end }}
</ul>
</article>
</section>
</div>
</main>
{{ partial "footer.html" . }}
</div>
</div>
{{ partial "bodyend.html" . }}
</body>
</html>
How can I sort the top level terms in this case?
Thank you in advance.
–Rick