Display posts one by one


#1

Right now I am having a blog that is built on top of Casper theme - it looks exactly like this: https://demo.ghost.io/

Right now, I want to display all posts one by one, with simple pagination (like 5 posts per page). Is that possible to do with Ghost?


#2

The simplest thing you should do

Remove from default.hbs:

 {{#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

<a class="last-page" href="{{page_url pages}}">{{t "Last Page"}} <span aria-hidden="true">&rarr;</span></a>

add link to last page