I’m trying to paginate a portfolio but I’m getting unexpected output.
In my _config.yml, I’ve got the following:
collections: portfolio: output: true defaults: - scope: type: portfolio values: layout: portfolio permalink: /:title/ pagination: enabled: true per_page: 6 permalink: '/page-:num/' title: ':title — Page :num' sort_reverse: true trail: before: 6 after: 6
I have a page,
portfolio.html, which has the following frontmatter:
--- layout: default title: Portfolio pagination: enabled: true collection: portfolio per_page: 9 ---
That page is pulling the correct data from
_portfolio, but it is using the
for loop from
blog.html. It doesn’t matter if I add a
for loop in the body of
portfolio.html or leave the body blank.
The pagination is working as expected, but the layout is wrong. Where have I gone wrong?