Exclude latest post from range

Displaying one latest post

{{ $blogs := site.GetPage "/blog/" }}
                {{ range first 1 $blogs.Pages }}
{{end}}

====

And on same page showing all blog post using pagination

 {{ $paginator := .Paginate (where .Site.RegularPages "Section" "blog") }}

                        {{ range $paginator.Pages }}
 {{end}}

===
Issue is latest post is also included in second query I want to exclude latest post

in this {{ $paginator := .Paginate (where .Site.RegularPages "Section" "blog") }} range

{{ $p := where site.RegularPages.ByDate.Reverse "Section" "blog" }}

<h2>The latest</h2>
{{ with index $p 0 }}
  <h3><a href="{{ .RelPermalink }}">{{ .Title }}</a></h3>
{{ end }}

<h2>The others</h2>
{{ range (.Paginate ($p | after 1)).Pages }}
  <h3><a href="{{ .RelPermalink }}">{{ .Title }}</a></h3>
{{ end }}
{{ template "_internal/pagination.html" . }}
2 Likes

Prefect. thanks this worked

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