Fix Pagination #1198
Fix Pagination #1198
Conversation
@mattr- this is ready for review :) |
@@ -29,7 +29,7 @@ class Configuration < Hash | |||
'baseurl' => '/', | |||
'include' => ['.htaccess'], | |||
'exclude' => [], | |||
'paginate_path' => 'page:num', | |||
'paginate_path' => '/page:num', |
mattr-
Jun 10, 2013
Member
I'm missing some context for this change. How is the added slash significant here?
I'm missing some context for this change. How is the added slash significant here?
parkr
Jun 10, 2013
Author
Member
It's not significant as far as I know.
It's not significant as far as I know.
parkr
Jun 10, 2013
Author
Member
I was just testing with both :)
I was just testing with both :)
# site - the Jekyll::Site object | ||
# | ||
# Returns the url of the template page | ||
def self.first_page_url(site) |
mattr-
Jun 10, 2013
Member
Do we have a URL helpers module or something where this method could go instead? I don't think this method belongs on the Pagination
class.
Do we have a URL helpers module or something where this method could go instead? I don't think this method belongs on the Pagination
class.
parkr
Jun 22, 2013
Author
Member
URL Helpers? Nope. Might be a good idea to add, but I'd rather do that in a different PR. It could also handle generation of URLs for Pages and Posts.
URL Helpers? Nope. Might be a good idea to add, but I'd rather do that in a different PR. It could also handle generation of URLs for Pages and Posts.
parkr
Jun 23, 2013
Author
Member
What do you think about this? Do you think a URL Helper to cover these two things is a good idea?
What do you think about this? Do you think a URL Helper to cover these two things is a good idea?
mattr-
Jun 25, 2013
Member
I don't really see the pattern that I was seeing before so I don't think we need a URL Helper to cover these two things anymore.
I don't really see the pattern that I was seeing before so I don't think we need a URL Helper to cover these two things anymore.
# site - the Jekyll::Site object | ||
# | ||
# Returns the Jekyll::Page which will act as the pager template | ||
def template_page(site) |
mattr-
Jun 10, 2013
Member
hmm, after seeing this method, I'm wondering if we don't need a TemplatePage
object for both this method and the previous method. Thoughts?
hmm, after seeing this method, I'm wondering if we don't need a TemplatePage
object for both this method and the previous method. Thoughts?
# | ||
# Returns the path with a leading slash | ||
def self.ensure_leading_slash(path) | ||
path[0..0] == "/" ? path : "/#{path}" |
mattr-
Jun 10, 2013
Member
Why use a range here?
Why use a range here?
parkr
Jun 10, 2013
Author
Member
Compatibility with 1.8.7. In 1.8.7, string[index]
returns the ordinal instead of the character.
Compatibility with 1.8.7. In 1.8.7, string[index]
returns the ordinal instead of the character.
assert_equal("page-2", Pager.paginate_path(Jekyll::Configuration::DEFAULTS.merge('paginate_path' => '/blog/page-:num'), 2)) | ||
assert_equal("/index.html", Pager.paginate_path(build_site, 1)) | ||
assert_equal("/page2", Pager.paginate_path(build_site, 2)) | ||
assert_equal("/index.html", Pager.paginate_path(build_site({'paginate_path' => '/blog/page-:num'}), 1)) |
mattr-
Jun 10, 2013
Member
This passes but I don't understand why.
Shouldn't we end up with /blog/index.html
here?
This passes but I don't understand why.
Shouldn't we end up with /blog/index.html
here?
parkr
Jun 10, 2013
Author
Member
No! There's no index.html file in the /blog
folder so it'll fall back to the root index.html
.
No! There's no index.html file in the /blog
folder so it'll fall back to the root index.html
.
@mattr- – Any further comments? I think I'd like to hold off on the URL Helper for a different PR. |
I'm cool with that. On Sat, Jun 22, 2013 at 10:08 AM, Parker Moore notifications@github.com
|
This comment has been minimized.
This comment has been minimized.
This change seems to break the pagination plugin in Octopress. Using Octopress 2.5, its pagination plugin takes two arguments for pagination_enabled? When I do a |
This comment has been minimized.
This comment has been minimized.
Yeah, 2.5 isn't ready for prime-time. |
New: Look for an index.html page starting in the
paginate_path
and searching upward (in the FS tree) until anindex.html
is found.