Infinite scroll

Hi, I’m using the Casper theme and I want to use the infinite-scroll.js file within the theme in a custom page I created. How can I achieve this?

This is my custom page file:
Ekran Resmi 2023-12-08 15.48.20

What I’m trying to do here is to list 6 posts when the user first visits the page, and then as they scroll down, fetch additional posts from the theme in sets of 3.

Casper has infinite scroll on the index.hbs page already, so I’d recommend taking a look at how it’s implemented there. I suspect the javascript that runs to create infinite scroll on index routes is not running on this page you’ve created.

Yes, it’s working on the index.hbs and author.hbs pages. However, I couldn’t figure out where the data for this code is coming from.
Ekran Resmi 2023-12-11 11.06.13

There is no HTML element or similar in the author.hbs file. It says ¨Used on all pages where there is a list of posts¨ but even if I directly copy and paste the code from the author.hbs file, the infinite scroll doesn’t work.