More Hugo

Mar 6, 2017 at 14:44

It’s taken a while, but I’ve managed to get the blog migrated over to Hugo, from Jekyll, since Hugo has a nice single exe, and isn’t Ruby.

In order to get taxonomies rendering in the general case under Hugo 0.19, add layouts/_default/terms.html:

{{ partial “header.html” . }}

<div class="section">
    <div>
        <h1 id="title">{{ .Title }}</h1>
        <ul>
            {{ $data := .Data }} {{ range $key,$value := .Data.Terms.ByCount }}
            <li>
                <h3><a href="{{ $data.Plural }}/{{ $value.Name | urlize }}"> {{ $value.Name }} </a> ({{ $value.Count }}) </h3>
            </li>
            {{ end }}
        </ul>
    </div>
</div>

{{ partial "footer.html" . }}

or something similar.

Taxonomies are only rendered to html if they are used. So defining tags and categories isn’t sufficient to produce a tags.html or categories.html file, until they are actually specified in the frontmatter of your post.