Side notes about Hugo

Some additional notes about Hugo: I’ve changed the pagination of the main page. The pagination was a bit broken, because I want only to show blog article, but not the flash posts. This was done by adding to the file of layouts/index.html to filter out pages.

<div class="catalogue">
  {{ range (.Paginate .Pages).Pages }}
  {{ end }}
</div>
<div class="catalogue">
  {{ range where (.Paginate .Pages).Pages "Section" "post" }}
  {{ end }}
</div>

The problem is simple: It get’s all pages and filter for the section the post originated from. However, most posts from me are a flash post lately. This way the list shrinks down and the first page seems quite short.

The solution for this is to change the pagination. Lucky, the hugo documentation provided a fitting example for this:

<div class="catalogue">
{{ $paginator := .Paginate (where .Pages "Type" "post") 10 }}
        {{ range where (.Paginate .Pages).Pages "Section" "post" }}
                {{ .Render "summary" }} 
        {{ end }}
</div>

Changed summaries

While working on this, I also updated the default value for the Automatic Summary Splitting. Hugo will take some lines of each post will display it in the overview. This is what the Summary implies. But most of the time this looked way to much. Instead, I reduced it to 20 down from 70.

Added read times

Also, I’ve updated the header of the blog posts to include the .ReadingTime. This way a reader can see how long a single posts takes to read. This is obviously a estimation, but it makes it more senseful for him if he wants to spend that time on the article or not.

so far, akendo