Switching to Content API v2 breaks `next_post` and `previous_post`

When enabling 'ghost-api':'v2' in package.json, next_post and prev_post cease producing output.

Here is my theme partial.

{{! Partial: Post Navigation }}

<section class="postnav">
    {{#next_post}}
        <a href="{{url}}" class="postnav-next">
            <div class="postnav-inner">
                <span class="postnav-type">{{t "Next Post"}}</span>
                <h4 class="postnav-title">{{title}}</h4>
                <div class="postnav-published"><time datetime="{{date format="YYYY-MM-DD"}}">{{date published_at format="MMMM Do, YYYY"}}</time></div>
            </div>
        </a>
    {{/next_post}}
    {{#prev_post}}
        <a href="{{url}}" class="postnav-previous">
            <div class="postnav-inner">
                <span class="postnav-type">{{t "Previous Post"}}</span>
                <h4 class="postnav-title">{{title}}</h4>
                <div class="postnav-published"><time datetime="{{date format="YYYY-MM-DD"}}">{{date published_at format="MMMM Do, YYYY"}}</time></div>
            </div>
        </a>
    {{/prev_post}}
</section>

What version of Ghost are you running? There was a fix for this in v2.12

Yes, that did it. However, I had to specify the version in Docker. ghost:latest pulled an earlier version. Is there a delay for Docker images to get updated?

@seb2point0 docker images are not official (and not officially supported), updates happen as and when the docker community do them

1 Like

Ah, understood.