{{#if pagination.pages}}
<script>
// maxPages is a global variable that is needed to determine
// if we need to load more pages for the infinitescroll, or if
// we reached the last page already.
var maxPages = parseInt('{{pagination.pages}}');</script>
<script src="{{asset "js/infinitescroll.js"}}"></script>
{{/if}}
change “posts_per_page” in package.json (template folder).
In index.hbs after
{{/foreach}}
</div>
add
{{#if pagination.pages}}
{{pagination}}
{{/if}}
I think you can also edit pagination.hbs and use foreach for create “1, 2, 3, 4, last page”. For example