2

Pagination works locally when i jekyll serve such that I get index.html with my first page of posts, but when i push and travis builds and then deploys the site, the home page lacks the first 10 posts. If I navigate to /page2 the 11-20 posts are there.

I noticed that the index.html in my source is not being rendered at all when i deploy. But it is being rendered when i serve locally.

What could cause the first page of posts to not render at all?

Here is my _config.yml setting

paginate: 10
paginate_path: "page:num"

here is my ci build script

#!/usr/bin/env bash
set -e # halt script on error

gem install jekyll-paginate
bundle update
bundle exec jekyll build

Here is what shows up on the index.html. Yet if i go to /page2 manually, the 11-20 posts show up. So its just something with the first page

enter image description here

UPDATE: I just checked on the server and the ./_site/index.html file is being generated properly. But the index.html that ends up in the root has no paging, no pages ... looks like the image above. I'm not sure why it is not being put in the root.

John Papa
  • 21,880
  • 4
  • 61
  • 60
  • 1
    Isn't it `bundle exec jekyll build` ? – David Jacquel Nov 24 '15 at 15:31
  • You should have `jekyll-paginate` in your Gemfile. This can also serve to ensure that you are running the same version in locally as on your build server. Does the problem persist if you do that? – Maxime Kjaer Nov 24 '15 at 16:24
  • yes, i have it in the gem file – John Papa Nov 25 '15 at 13:01
  • I have exactly the same problem with Jekyl v3.x, and could not solve it. I tried [Jekyll Talk](https://talk.jekyllrb.com/t/jekyll-3-x-with-github-pages/1832) but even there they couldn't help me to solve this issue yet! – Virtua Creative Jan 31 '16 at 16:43

1 Answers1

0

try this way: change to paginate_path: "/page:num" , in _config.yml
and also add

<div class="pagination">
{% if paginator.previous_page %}<a class="new" href="{{ paginator.previous_page_path }}"></i> newst post </a>{% endif %}
{% if paginator.previous_page %} {%if paginator.next_page %} <span class="sep"></span> {% endif %}{% endif %}
{% if paginator.next_page %}<a class="olderpage" href="{{ paginator.next_page_path }}">oldest post</i> </a>{% endif %}

in last line of index.html

Yahya
  • 706
  • 8
  • 23
  • I have those in the index.html. they number of posts are not showing up. the buttons are disabled – John Papa Nov 25 '15 at 13:14
  • do you change (paginate_path: "page:num" ) to (paginate_path: "/page:num") ; exactly add / before page !? – Yahya Nov 25 '15 at 13:45
  • yep, tried both. the problem is that locally it generates the index.html in the root, but it doesnt work on deploy. the page2 ... pagen work – John Papa Nov 30 '15 at 14:45