Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Paginate in subdirectories properly #1016

Merged
merged 6 commits into from May 5, 2013

Conversation

Projects
None yet
5 participants
@parkr
Copy link
Member

parkr commented May 5, 2013

Before, it was using /index.html instead of the index.html in the subdirectory specified in the paginate_path config setting. I used the blog posted in #878 as my test.

Fixes #878, #984.

@@ -23,7 +23,7 @@ class TestPager < Test::Unit::TestCase
end

should "report that pagination is disabled" do
assert !Pager.pagination_enabled?(@config, 'index.html')
assert !Pager.pagination_enabled?(@config, OpenStruct.new(name: 'index.html', dir: '/'))

This comment has been minimized.

Copy link
@parkr

parkr May 5, 2013

Author Member

lol, forgot about 1.8.7.

@parkr

This comment has been minimized.

Copy link
Member Author

parkr commented May 5, 2013

// @mattr-

parkr added a commit that referenced this pull request May 5, 2013

Merge pull request #1016 from mojombo/fix-pagination
Paginate in subdirectories properly

@parkr parkr merged commit 0b1d22d into master May 5, 2013

1 check passed

default The Travis build passed
Details

@parkr parkr deleted the fix-pagination branch May 5, 2013

@virtualjoker

This comment has been minimized.

Copy link

virtualjoker commented May 11, 2013

It solved the problem? I'm still getting this problem in my github page.

@parkr

This comment has been minimized.

Copy link
Member Author

parkr commented May 11, 2013

You're getting many pages?

@darryl-snow

This comment has been minimized.

Copy link

darryl-snow commented May 25, 2013

I'm still getting this too. In /blog/index.html I've got:

---
layout: blog-index
---

                <ul class="blog-list">

{% for post in paginator.posts %}
    {% if post.categories contains 'blog' and post.language == 'english' %}

                    <li>
                        <a href="">
                            <h2>{{ post.title }}</h2>
                            <p class="date-posted">{{ post.date | date: "%B %d, %Y" }}</p>
                            <p>{{ post.excerpt }}</p>
                        </a>
                    </li>

    {% endif %}
{% endfor %}

                </ul>

It works if I put this code in /index.html and used to work before I upgraded to 1.0. I have _posts folders in / and /blog , which worked before.

@adobo

This comment has been minimized.

Copy link

adobo commented Jul 2, 2013

I'm having exactly the same problem on Jekyll 1.0.3. Seems like paginator isn't defined for subfolders.

@darryl-snow

This comment has been minimized.

Copy link

darryl-snow commented Jul 2, 2013

@adobo I solved my problem by just doing this instead:

{% for post in site.posts %}
@parkr

This comment has been minimized.

Copy link
Member Author

parkr commented Jul 2, 2013

@adobo The paginator has been fixed and will be released with 1.1. :)

@adobo

This comment has been minimized.

Copy link

adobo commented Jul 4, 2013

@parkr great to hear that!

@jekyll jekyll locked and limited conversation to collaborators Feb 27, 2017

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.