Home list page showing just POSTS

Hi. I upgraded from 0.52 to 0.92.1 and now my home page that shows a list of summaries of my posts, paginated, just shows POSTS instead of the list.

What changed between versions?

This is the chunk where the summaries should be displayed:

{{ define "main" }} 
{{ $paginator := .Paginate  (where .Pages.ByDate.Reverse "Section" "eq" "post" )}} {{ partial "pagination.html" . }} {{ range $paginator.Pages}}
<article>
    <h1>{{.Title}}</h1>
    <div class="author">By <span id="twitter"><a
        href="{{$.Site.Params.twitterURL}}"><strong>{{ .Site.Params.author}}</strong> <i
          class="fab fa-twitter"></i></a></span> on
        <date>
            {{.Date.Format .Site.Params.dateFormat }}
        </date>
    </div>
    <p> {{ .Summary }}
    </p>
    {{ if .Truncated }}
    <div class="read_more">
        <a href="{{ .RelPermalink }}">Read More…</a></div>
    {{ end }}
   {{ partial "tags.html" .}}

</article>
<div class="post_separator">~ ~ ~</div>
{{ end }} {{ partial "pagination.html" . }} {{ end }}

Most likely this issue. You can modify the theme and use mainSections on line 2.

Also: where | Hugo

Also: what does hugo server say on the CLI? Any warnings and errors?

No errors!

Indeed! Had to:

{{ $paginator := .Paginate (where .Site.RegularPages “Type” “post”)}}

Thanks!

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.