# Paginate-v2 leaving blank spot

**URL:** https://talk.jekyllrb.com/t/paginate-v2-leaving-blank-spot/6478
**Category:** Help
**Created:** [September 23, 2021, 5:37am UTC](https://talk.jekyllrb.com/t/paginate-v2-leaving-blank-spot/6478 "2021-09-23T05:37:44Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![guy](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/guy/32/3917_2.png) [@guy](https://talk.jekyllrb.com/u/guy)
#### Post date: [September 23, 2021, 5:37am UTC](https://talk.jekyllrb.com/t/paginate-v2-leaving-blank-spot/6478/1 "2021-09-23T05:37:44Z")

</div>

I migrated from regular vanilla jekyll-paginate to `jekyll-paginate-v2`. It went pretty smooth and everything works as expected except for one hiccup, my settings are set to have 9 blog posts per page but it is making 8 on the first page, leaving a blank spot for the 9th. Then doing it correctly on page 2. This never happened with the old plugin and i didn’t change anything besides the `_config.yml` and gem file.

Here are my settings:  
\_config.yml:

```auto
plugins:
  - jekyll-feed

gems:
  - jekyll-paginate-v2

# Pagination Settings
pagination:
  enabled: true
  per_page: 9
  permalink: '/page:num/'
  title: ' - page :num'
  limit: 0
  sort_field: 'post-priority'
  sort_reverse: false
  debug: true

```

gem file:

```auto
source "https://rubygems.org"
gem 'github-pages'
gem 'jekyll-sitemap'
gem 'jekyll-paginate-v2'

```

---

<div class="post-metadata">

### Author: ![jack](https://avatars.discourse-cdn.com/v4/letter/j/cc9497/32.png) [@jack](https://talk.jekyllrb.com/u/jack)
#### Post date: [September 23, 2021, 6:06am UTC](https://talk.jekyllrb.com/t/paginate-v2-leaving-blank-spot/6478/2 "2021-09-23T06:06:42Z")

</div>

What version of Jekyll are you using ? For me paginate doesn’t work with 4.0

---

<div class="post-metadata">

### Author: ![guy](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/guy/32/3917_2.png) [@guy](https://talk.jekyllrb.com/u/guy)
#### Post date: [September 23, 2021, 6:09am UTC](https://talk.jekyllrb.com/t/paginate-v2-leaving-blank-spot/6478/3 "2021-09-23T06:09:01Z")

</div>

@jack I am using version 3.9.0

---

<div class="post-metadata">

### Author: ![jackyjoy123](https://avatars.discourse-cdn.com/v4/letter/j/d6d6ee/32.png) [@jackyjoy123](https://talk.jekyllrb.com/u/jackyjoy123)
#### Post date: [September 23, 2021, 1:07pm UTC](https://talk.jekyllrb.com/t/paginate-v2-leaving-blank-spot/6478/4 "2021-09-23T13:07:05Z")

</div>

> [@jack](#):
>
> What version of Jekyll are you using ? For me paginate doesn’t work with 4.0

thanks for the awesome information.

---

<div class="post-metadata">

### Author: ![jack](https://avatars.discourse-cdn.com/v4/letter/j/cc9497/32.png) [@jack](https://talk.jekyllrb.com/u/jack)
#### Post date: [September 23, 2021, 4:54pm UTC](https://talk.jekyllrb.com/t/paginate-v2-leaving-blank-spot/6478/5 "2021-09-23T16:54:52Z")

</div>

Can you share your code or GitHub repo, it will be helpful to debug that way.i

---

<div class="post-metadata">

### Author: ![guy](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/guy/32/3917_2.png) [@guy](https://talk.jekyllrb.com/u/guy)
#### Post date: [September 23, 2021, 5:57pm UTC](https://talk.jekyllrb.com/t/paginate-v2-leaving-blank-spot/6478/6 "2021-09-23T17:57:00Z")

</div>

@jack The repo is private but I can share as much as i can. The complete gemfile is shared in my first comment.

Here is most of the `_config.yml`, just excluded identity info that shouldn’t be relevant anyway:

```auto
# Layout settings
header_type: default # values [drawer, default]
post_type: highlight # values [highlight, default]
pagination_type: default # values [ops, default]
report_type: default
collections:
  reports:
    output: true

disqus: false

# Build settings
markdown: kramdown

plugins:
  - jekyll-feed
  - jekyll-sitemap
  - jekyll-seo-tag
  - jekyll-paginate-v2

# paginate: 9
# paginate_path: "/page:num/"

# Pagination Settings
pagination:
  enabled: true
  per_page: 9
  permalink: '/page:num/'
  title: ' - page :num'
  limit: 0
  sort_field: 'post-priority'
  sort_reverse: false
  debug: true

```

and here is the pagination part of the `index.html`, again not gonna post it all cause most is not relevant to it:

```auto

  {% if paginator.total_pages > 1 %}
  <div class="wj-pagination"> 
    {% if paginator.previous_page %}
      <a href="{{ paginator.previous_page_path | prepend: site.baseurl | replace: '//', '/' }}">&laquo; Prev</a>
    {% else %}
      <span>&laquo; Prev</span>
    {% endif %}
  
    {% for page in (1..paginator.total_pages) %}
      {% if page == paginator.page %}
        <span class="active">{{ page }}</span>
      {% elsif page == 1 %}
        <a href="/">{{ page }}</a>
      {% else %}
        <a href="{{ site.paginate_path | prepend: site.baseurl | replace: '//', '/' | replace: ':num', page }}">{{ page }}</a>
      {% endif %}
    {% endfor %}
  
    {% if paginator.next_page %}
      <a href="{{ paginator.next_page_path | prepend: site.baseurl | replace: '//', '/' }}">Next &raquo;</a>
    {% else %}
      <span>Next &raquo;</span>
    {% endif %}
  </div>
  {% endif %}

```

---

<div class="post-metadata">

### Author: ![guy](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/guy/32/3917_2.png) [@guy](https://talk.jekyllrb.com/u/guy)
#### Post date: [September 23, 2021, 11:56pm UTC](https://talk.jekyllrb.com/t/paginate-v2-leaving-blank-spot/6478/7 "2021-09-23T23:56:58Z")

</div>

I found out the reason why there is a blank spot only on the first page. I forgot i have a highlighted post at the top that is different from the rest so it counts in the paginator counter. So i thought setting the [offset of the plugin](https://github.com/sverrirs/jekyll-paginate-v2/blob/master/README-GENERATOR.md#offsetting-posts) to 1 would solve it but it didn’t do anything 🤔

Here is the start of my `index.html` that involves the highlighted post:

```auto
---
layout: default
pagination: 
  enabled: true
---
<div class="page-content">
  <div class="mdl-grid">

 {% assign sortedPosts = paginator.posts | sort: 'post-priority' %}

  {% if site.post_type == 'highlight' %}

    {% for post in sortedPosts %}
    {% if post.highlight %}
    <div class="section-highlight section--center mdl-grid mdl-grid--no-spacing mdl-shadow--2dp">

      <header class="section__play-btn mdl-cell mdl-cell--3-col-desktop mdl-cell--2-col-tablet mdl-cell--4-col-phone" {% if post.image %} style="background: url('{{ post.image }}') center/cover;" {% endif %}></header>

      <div class="mdl-card mdl-cell mdl-cell--9-col-desktop mdl-cell--6-col-tablet mdl-cell--4-col-phone">
        <div class="mdl-card__supporting-text">
          <h4>{{ post.title }}</h4>
          <p>{{ post.excerpt }}</p>
        </div>
        <div class="mdl-card__actions">
          <a class="mdl-button mdl-button--colored mdl-js-button mdl-js-ripple-effect" href="{{ post.url | prepend: site.baseurl }}">Read More</a>
        </div>
      </div>
      ...

```
