What I am trying to do is simple, get page 1 to have a different layout than page 2 and all others in the pagination.
Their content would be the following
Homepage / page 1
- List of 3 highlights (included with a partial)
- The most recent post (let’s call it post 1)
- pagination links
Second page and following pages
- Next 9 posts ( post 2, 3, 4 … 10)
- pagination links
So far, this is working:
{{ $loop := (.Paginate (where .Data.Pages "Type" "!=" "page") 1).Pages }}
{{ partial "highlighted_stories.html" . }}
{{ range $loop }}
{{ .Render "li" }}
{{ end }}
On page 2, I get just one post because it’s the same loop.
I was thinking about having two different loops running on this page but that would mess up the pagination.
My question is, what would be the best approach to this problem in your opinion ?
(I Could swear I have asked this question before, but couldn’t find the initial post to follow it up.)
For now I am using a list.html file on the /post section of the theme. On the frontpage, if the user clicks on the next-page link, i direct him to /post instead.