Custom theme pagination navigates 404

Hello,

I’m trying to create a custom theme for my website. I’m using a custom homepage and viewing blog posts under /blog. I used {{pagination}} in my index.hbs and I used the standard partials/pagination.hbs and until here, everything is fine. I can see the pagination and the URLs.

But when I try to navigate http://localhost:2368/blog/page/2/ I get 404
When I try to navigate http://localhost:2368/blog/page/1/ it redirects to http://localhost:2368/blog/ and shows the normal working blog list page.

How can I view paginated URLs ?

My routes.yaml is like this

routes:
/:
template: home
data: page.home

collections:
/blog/:
permalink: /blog/{slug}/
template: index
filter: tag:-course
/courses/:
permalink: /courses/{slug}/
template: custom-courses
filter: tag:course

taxonomies:
tag: /tag/{slug}/
author: /author/{slug}/

Do you have enough posts that there should be a page 2?

Yes of course

{{#get “posts” limit=“1” page=pagination.page include=“tags” as |post|}}

to be sure I’m using 1 post per page and I see many pages in the pagination

Ok. I think the pagination helper uses the number of posts set in the configuration file, not your limit.

1 Like

Perfect thank you very much it’s solved

1 Like