Site in costruction

Exobrain

Home of inorganic intellectual chaos and unpolished content

A Sane Guide to Hugo

Hugo is a Static Site Generator

Note

Validated for Hugo extended v101

Basics

Project structure

Correlation beetween files

Working with themes

Developing a theme

Patterns and best practices

You need to filter .Site.Pages by section using the where function. Try this:

<ul>
{{ range where .Site.Pages "Section" .Section }}
  <li>{{ .Title }}</li>
{{ end }}
</ul>

If you want to avoid empty lists, you can store the slice of section pages in a variable and check its length before you output the ul tags.

{{ $sectionPages := where .Site.Pages "Section" .Section }}
{{ if ge (len $sectionPages) 1 }}
  <ul>
    {{ range $sectionPages }}
      <li>{{ .Title }}</li>
    {{ end }}
  </ul>
{{ end }}