-
-
Notifications
You must be signed in to change notification settings - Fork 10k
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
Improved pagination support #521
Conversation
devknoll
commented
Mar 8, 2012
- Exposed some properties in Page that weren't previously available.
- Folded in jekyll-pagination to support non-Index.html pagination and allowing for paginating files in sub-directories (e.g. /blog/index.html)
- Defaults to index.html for backward compatibility.
- Allow for customizing the pagination url style (e.g. /blog/page/:page => /blog/page/1).
- Defaults to page:page (page#) for backward compatibility.
* Folded in jekyll-pagination with additional support for paginating files in directories and modifying the pagination url style.
+1 for non- |
+1 for customizing pagination URL style. It would be great if I can have project site landing page to be 'about the project' and then to have blog in a sub-directory as '/blog/*'. |
A lot of people (including me) have been using custom hacks for pagination in subdirectories – I'd love to have it available by default. |
How has this not been accepted yet?!?!?!? |
@nathggns if you havent noticed there are over 200 issues on this repo, and not a commit in 2 months. I would suggest using a fork or making your own. |
@svnpenn How would I go about doing this? Like many others, I installed Jekyll with |
If you just want these changes, you can drop the modified pagination.rb and page.rb into your _plugins folder and they will just work. Keep in mind that this won't work with GitHub Pages. |
@devknoll Thanks, but I noticed it doesn't work plug and play. What extra work do I have to do? I put that in plugins and it actually broke page1 (blog/index.html) |
That is incorrect. It will work with GitHub pages, as long as you dont rely on GitHub's Jekyll to do the transforming. |
This would be a great addition! Category pagination seems to be one of the most commonly requested features, and this is a pretty seamless way to get it working. |
newpage.pager = pager | ||
newpage.dir = File.join(page.dir, "page#{num_page}") | ||
newpage.dir = File.join(page.dir, template.gsub(/:page/, num_page.to_s)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my installation, I had to change this to File.join(page.source_dir
instead of page.dir
. This was for paginating blog/index.html; as-is it kept generating the page2
folder in the root directory instead of in blog/
, as page.dir
just returned /
. I'm new to Jekyll so I'm not sure if this is a bug with the patch or a bug in my setup or configuration.
+1 on pagination in subdirectories. I host my jekyll blog with gh-pages, so to have this in by default would be great. |
+1 on this as well. |
+1 for customizing pagination URL style |
+1 for pagination in subdirectories |
I would really like to see this. Every way around this limitation feels like a hack, or plugin. |
+1 for pagination in subdirectories |
Oh @mojombo please merge this :( |
I want these features, but I am no expert on whether this code is worthy or not. But I would love to have this feature available for my github pages blog! |
@devknoll You must add tests before this will be considered for integration into the project. Thanks for the hard work, though. |
@nimbupani The status of this repository and that of GitHub Pages have little to to with one another. |
One workaround to have a paginated blog on a different page than the index with the restrictions of gh-pages is to have your main, non-paginated website pages in your [username].github.com repository, then your paginated blog in a separate repository with the name of whatever sub-page you want your paginated blog under. IE: This is the main landing page + any other pages: https://github.com/username/username.github.com The second website should respect your CNAME that is set in [username].github.com and work seamlessly with that repository. There might even be some creative room for submodules in this mix. Inspiration for this idea came from how https://github.com/yihui/yihui.github.com deals with two separate languages on his website. Technically, its two separate sites, but if you want additional pages paginated, and you don't want to use plugins or are deploying to gh-pages, then this works right now. It would be nice to be able to arbitrarily paginate sections of a site, IE paginated blog index that isn't the main index while also paginating other pages on the same website like an archives page. Octopress has some really basic support for this kind of thing. |
Sure. But if it were in the core and if Github Pages were upgraded then |
Yeppers. This will require tests so we don't break it in the future. |
it seems like custom pagination urls were added, but not the ability to paginate content on pages other than the main index.html, for example blog/index.html does not respect the paginate_path – it defaults to blog/page2. |
I can use |
any updates on this? my paginated generated pages don't use the correct layout |
Re-done on #936. |