Hugo Static Site Generator v0.58.3/extended darwin/amd64 BuildDate: unknown
Before update I had:
Now I have:
^ this Posts is a link to http://localhost:1313/posts/
{{ $paginator := .Paginate (where .Pages "Section" "posts") }}
or
{{ $paginator := .Paginate (where .Pages "Type" "posts") }}
list the same what is above.
Considering documentation it should be still valid:
I have no idea what is happening here. Debugging hugo template is a nightmare
{{ $paginator := .Paginate (where .Pages "Section" "posts") }}
<pre>{{ $paginator | jsonify }}</pre>
<br />---<br />
{{ printf "%#v" $paginator }}
{{/* posts summaries */}}
{{ range $post := $paginator.Pages }}
<div class="row no-gutters post-summary" onclick="location.href='{{ $post.RelPermalink }}';">
<div class="{{ if $post.Resources.Match "thumbnail" }}col-md-8{{ end }} post-content">
<a href="{{ $post.RelPermalink }}"><h1>{{ $post.Title }}</h1></a>
<div class="post-meta">{{ $post.Date.Format "2006-01-02" }}
{{ if lt $post.Date $post.Lastmod }}
<span>(updated: {{ $post.Lastmod.Format "2006-01-02" }})</span><br />
{{ end }}
{{ partial "taxonomy-terms.html" (dict "root" . "taxonomy" "tags")}}
</div>
<p class="summary"><a href="{{ $post.RelPermalink }}">{{ .Summary }}</a></p>
</div>
{{ with index (.Resources.Match "thumbnail") 0 }}
<div class="col-md-4 post-image">
<a href="{{ $post.RelPermalink }}">
<img class="img-fluid" src="{{ .RelPermalink }}" alt="{{ .Title }}">
</a>
</div>
{{ end }}
</div>
{{ end }}
{{/* pagination */}}
{{ if gt $paginator.TotalPages 1 }}
<nav>
<ul class="pagination justify-content-center" style="flex-wrap: wrap">
<li class="page-item{{ if not $paginator.HasPrev }} disabled {{ end }}">
<a class="page-link" href="{{ if $paginator.HasPrev }}{{ $paginator.Prev.URL }}{{ end }}">
<span aria-hidden="true">«</span>
</a>
</li>
{{ range .Paginator.Pagers }}
<li class="page-item{{ if eq . $paginator }} active{{ end }}"><a class="page-link" href="{{ .URL }}">{{ .PageNumber }}</a></li>
{{ end }}
<li class="page-item{{ if not $paginator.HasNext }} disabled {{ end }}">
<a class="page-link" href="{{ if $paginator.HasNext }}{{ $paginator.Next.URL }}{{ end }}">
<span aria-hidden="true">»</span>
</a>
</li>
</ul>
</nav>
{{ end }}